diff --git a/packages/google-cloud-dialogflow-cx/.coveragerc b/packages/google-cloud-dialogflow-cx/.coveragerc
new file mode 100644
index 000000000000..a6e44e2db69e
--- /dev/null
+++ b/packages/google-cloud-dialogflow-cx/.coveragerc
@@ -0,0 +1,18 @@
+[run]
+branch = True
+
+[report]
+fail_under = 100
+show_missing = True
+omit =
+ google/cloud/dialogflowcx/__init__.py
+exclude_lines =
+ # Re-enable the standard pragma
+ pragma: NO COVER
+ # Ignore debug-only repr
+ def __repr__
+ # Ignore pkg_resources exceptions.
+ # This is added at the module level as a safeguard for if someone
+ # generates the code and tries to run it without pip installing. This
+ # makes it virtually impossible to test properly.
+ except pkg_resources.DistributionNotFound
diff --git a/packages/google-cloud-dialogflow-cx/.github/header-checker-lint.yml b/packages/google-cloud-dialogflow-cx/.github/header-checker-lint.yml
new file mode 100644
index 000000000000..fc281c05bd55
--- /dev/null
+++ b/packages/google-cloud-dialogflow-cx/.github/header-checker-lint.yml
@@ -0,0 +1,15 @@
+{"allowedCopyrightHolders": ["Google LLC"],
+ "allowedLicenses": ["Apache-2.0", "MIT", "BSD-3"],
+ "ignoreFiles": ["**/requirements.txt", "**/requirements-test.txt"],
+ "sourceFileExtensions": [
+ "ts",
+ "js",
+ "java",
+ "sh",
+ "Dockerfile",
+ "yaml",
+ "py",
+ "html",
+ "txt"
+ ]
+}
\ No newline at end of file
diff --git a/packages/google-cloud-dialogflow-cx/.gitignore b/packages/google-cloud-dialogflow-cx/.gitignore
index b9daa52f118d..b4243ced74e4 100644
--- a/packages/google-cloud-dialogflow-cx/.gitignore
+++ b/packages/google-cloud-dialogflow-cx/.gitignore
@@ -50,8 +50,10 @@ docs.metadata
# Virtual environment
env/
+
+# Test logs
coverage.xml
-sponge_log.xml
+*sponge_log.xml
# System test environment variables.
system_tests/local_test_setup
diff --git a/packages/google-cloud-dialogflow-cx/.kokoro/build.sh b/packages/google-cloud-dialogflow-cx/.kokoro/build.sh
index a60755e54e36..e6b479bf5c97 100755
--- a/packages/google-cloud-dialogflow-cx/.kokoro/build.sh
+++ b/packages/google-cloud-dialogflow-cx/.kokoro/build.sh
@@ -15,7 +15,11 @@
set -eo pipefail
-cd github/python-dialogflow-cx
+if [[ -z "${PROJECT_ROOT:-}" ]]; then
+ PROJECT_ROOT="github/python-dialogflow-cx"
+fi
+
+cd "${PROJECT_ROOT}"
# Disable buffering, so that the logs stream through.
export PYTHONUNBUFFERED=1
@@ -30,16 +34,26 @@ export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/service-account.json
export PROJECT_ID=$(cat "${KOKORO_GFILE_DIR}/project-id.json")
# Remove old nox
-python3.6 -m pip uninstall --yes --quiet nox-automation
+python3 -m pip uninstall --yes --quiet nox-automation
# Install nox
-python3.6 -m pip install --upgrade --quiet nox
-python3.6 -m nox --version
+python3 -m pip install --upgrade --quiet nox
+python3 -m nox --version
+
+# If this is a continuous build, send the test log to the FlakyBot.
+# See https://github.com/googleapis/repo-automation-bots/tree/master/packages/flakybot.
+if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"continuous"* ]]; then
+ cleanup() {
+ chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot
+ $KOKORO_GFILE_DIR/linux_amd64/flakybot
+ }
+ trap cleanup EXIT HUP
+fi
# If NOX_SESSION is set, it only runs the specified session,
# otherwise run all the sessions.
if [[ -n "${NOX_SESSION:-}" ]]; then
- python3.6 -m nox -s "${NOX_SESSION:-}"
+ python3 -m nox -s ${NOX_SESSION:-}
else
- python3.6 -m nox
+ python3 -m nox
fi
diff --git a/packages/google-cloud-dialogflow-cx/.kokoro/docs/docs-presubmit.cfg b/packages/google-cloud-dialogflow-cx/.kokoro/docs/docs-presubmit.cfg
index 1118107829b7..abe915cede5b 100644
--- a/packages/google-cloud-dialogflow-cx/.kokoro/docs/docs-presubmit.cfg
+++ b/packages/google-cloud-dialogflow-cx/.kokoro/docs/docs-presubmit.cfg
@@ -15,3 +15,14 @@ env_vars: {
key: "TRAMPOLINE_IMAGE_UPLOAD"
value: "false"
}
+
+env_vars: {
+ key: "TRAMPOLINE_BUILD_FILE"
+ value: "github/python-dialogflow-cx/.kokoro/build.sh"
+}
+
+# Only run this nox session.
+env_vars: {
+ key: "NOX_SESSION"
+ value: "docs docfx"
+}
diff --git a/packages/google-cloud-dialogflow-cx/.trampolinerc b/packages/google-cloud-dialogflow-cx/.trampolinerc
index 995ee29111e1..383b6ec89fbc 100644
--- a/packages/google-cloud-dialogflow-cx/.trampolinerc
+++ b/packages/google-cloud-dialogflow-cx/.trampolinerc
@@ -24,6 +24,7 @@ required_envvars+=(
pass_down_envvars+=(
"STAGING_BUCKET"
"V2_STAGING_BUCKET"
+ "NOX_SESSION"
)
# Prevent unintentional override on the default image.
diff --git a/packages/google-cloud-dialogflow-cx/CONTRIBUTING.rst b/packages/google-cloud-dialogflow-cx/CONTRIBUTING.rst
index 7485098a5631..37c5a8322c34 100644
--- a/packages/google-cloud-dialogflow-cx/CONTRIBUTING.rst
+++ b/packages/google-cloud-dialogflow-cx/CONTRIBUTING.rst
@@ -70,9 +70,14 @@ We use `nox `__ to instrument our tests.
- To test your changes, run unit tests with ``nox``::
$ nox -s unit-2.7
- $ nox -s unit-3.7
+ $ nox -s unit-3.8
$ ...
+- Args to pytest can be passed through the nox command separated by a `--`. For
+ example, to run a single test::
+
+ $ nox -s unit-3.8 -- -k
+
.. note::
The unit tests and system tests are described in the
@@ -93,8 +98,12 @@ On Debian/Ubuntu::
************
Coding Style
************
+- We use the automatic code formatter ``black``. You can run it using
+ the nox session ``blacken``. This will eliminate many lint errors. Run via::
+
+ $ nox -s blacken
-- PEP8 compliance, with exceptions defined in the linter configuration.
+- PEP8 compliance is required, with exceptions defined in the linter configuration.
If you have ``nox`` installed, you can test that you have not introduced
any non-compliant code via::
@@ -133,13 +142,18 @@ Running System Tests
- To run system tests, you can execute::
- $ nox -s system-3.7
+ # Run all system tests
+ $ nox -s system-3.8
$ nox -s system-2.7
+ # Run a single system test
+ $ nox -s system-3.8 -- -k
+
+
.. note::
System tests are only configured to run under Python 2.7 and
- Python 3.7. For expediency, we do not run them in older versions
+ Python 3.8. For expediency, we do not run them in older versions
of Python 3.
This alone will not run the tests. You'll need to change some local
diff --git a/packages/google-cloud-dialogflow-cx/LICENSE b/packages/google-cloud-dialogflow-cx/LICENSE
index a8ee855de2aa..d64569567334 100644
--- a/packages/google-cloud-dialogflow-cx/LICENSE
+++ b/packages/google-cloud-dialogflow-cx/LICENSE
@@ -1,6 +1,7 @@
- Apache License
+
+ Apache License
Version 2.0, January 2004
- https://www.apache.org/licenses/
+ http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
@@ -192,7 +193,7 @@
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
- https://www.apache.org/licenses/LICENSE-2.0
+ 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,
diff --git a/packages/google-cloud-dialogflow-cx/MANIFEST.in b/packages/google-cloud-dialogflow-cx/MANIFEST.in
index e9e29d12033d..e783f4c6209b 100644
--- a/packages/google-cloud-dialogflow-cx/MANIFEST.in
+++ b/packages/google-cloud-dialogflow-cx/MANIFEST.in
@@ -16,10 +16,10 @@
# Generated by synthtool. DO NOT EDIT!
include README.rst LICENSE
-recursive-include google *.json *.proto
+recursive-include google *.json *.proto py.typed
recursive-include tests *
global-exclude *.py[co]
global-exclude __pycache__
# Exclude scripts for samples readmegen
-prune scripts/readme-gen
\ No newline at end of file
+prune scripts/readme-gen
diff --git a/packages/google-cloud-dialogflow-cx/README.rst b/packages/google-cloud-dialogflow-cx/README.rst
index 6bf68b2631e7..bfe57a441e7d 100644
--- a/packages/google-cloud-dialogflow-cx/README.rst
+++ b/packages/google-cloud-dialogflow-cx/README.rst
@@ -1,23 +1,6 @@
-Python Client for Dialogflow CX API
+Python Client for Google Cloud Dialogflowcx API
=================================================
-|beta| |pypi| |versions|
-
-`Dialogflow CX API`_: Builds conversational interfaces (for example, chatbots, and voice-powered apps and devices).
-
-- `Client Library Documentation`_
-- `Product Documentation`_
-
-.. |beta| image:: https://img.shields.io/badge/support-beta-orange.svg
- :target: https://github.com/googleapis/google-cloud-python/blob/master/README.rst#beta-support
-.. |pypi| image:: https://img.shields.io/pypi/v/google-cloud-dialogflow-cx.svg
- :target: https://pypi.org/project/google-cloud-dialogflow-cx/
-.. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-dialogflow-cx.svg
- :target: https://pypi.org/project/google-cloud-dialogflow-cx/
-.. _Dialogflow CX API: https://cloud.google.com/dialogflow/cx/docs
-.. _Client Library Documentation: https://googleapis.dev/python/dialogflow-cx/latest
-.. _Product Documentation: https://cloud.google.com/dialogflow/cx/docs
-
Quick Start
-----------
@@ -25,12 +8,11 @@ In order to use this library, you first need to go through the following steps:
1. `Select or create a Cloud Platform project.`_
2. `Enable billing for your project.`_
-3. `Enable the Dialogflow CX API.`_
+3. Enable the Google Cloud Dialogflowcx API.
4. `Setup Authentication.`_
.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project
.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project
-.. _Enable the Dialogflow CX API.: https://cloud.google.com/dialogflow/cx/docs
.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html
Installation
@@ -52,10 +34,9 @@ Mac/Linux
.. code-block:: console
- pip install virtualenv
- virtualenv
+ python3 -m venv
source /bin/activate
- /bin/pip install google-cloud-dialogflow-cx
+ /bin/pip install /path/to/library
Windows
@@ -63,20 +44,6 @@ Windows
.. code-block:: console
- pip install virtualenv
- virtualenv
+ python3 -m venv
\Scripts\activate
- \Scripts\pip.exe install google-cloud-dialogflow-cx
-
-Next Steps
-~~~~~~~~~~
-
-- Read the `Client Library Documentation`_ for Cloud Dialogflow CX API
- API to see other available methods on the client.
-- Read the `Dialogflow CX API Product documentation`_ to learn
- more about the product and see How-to Guides.
-- View this `README`_ to see the full list of Cloud
- APIs that we cover.
-
-.. _Dialogflow CX API Product documentation: https://cloud.google.com/dialogflow/cx/docs
-.. _README: https://github.com/googleapis/google-cloud-python/blob/master/README.rst
\ No newline at end of file
+ \Scripts\pip.exe install \path\to\library
diff --git a/packages/google-cloud-dialogflow-cx/docs/_static/custom.css b/packages/google-cloud-dialogflow-cx/docs/_static/custom.css
index 0abaf229fce3..bcd37bbd3c4a 100644
--- a/packages/google-cloud-dialogflow-cx/docs/_static/custom.css
+++ b/packages/google-cloud-dialogflow-cx/docs/_static/custom.css
@@ -1,4 +1,9 @@
div#python2-eol {
border-color: red;
border-width: medium;
-}
\ No newline at end of file
+}
+
+/* Ensure minimum width for 'Parameters' / 'Returns' column */
+dl.field-list > dt {
+ min-width: 100px
+}
diff --git a/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/agents.rst b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/agents.rst
new file mode 100644
index 000000000000..fbd83fe087db
--- /dev/null
+++ b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/agents.rst
@@ -0,0 +1,11 @@
+Agents
+------------------------
+
+.. automodule:: google.cloud.dialogflowcx_v3.services.agents
+ :members:
+ :inherited-members:
+
+
+.. automodule:: google.cloud.dialogflowcx_v3.services.agents.pagers
+ :members:
+ :inherited-members:
diff --git a/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/entity_types.rst b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/entity_types.rst
new file mode 100644
index 000000000000..c6b68f5dc2ee
--- /dev/null
+++ b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/entity_types.rst
@@ -0,0 +1,11 @@
+EntityTypes
+-----------------------------
+
+.. automodule:: google.cloud.dialogflowcx_v3.services.entity_types
+ :members:
+ :inherited-members:
+
+
+.. automodule:: google.cloud.dialogflowcx_v3.services.entity_types.pagers
+ :members:
+ :inherited-members:
diff --git a/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/environments.rst b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/environments.rst
new file mode 100644
index 000000000000..fc10a8e80957
--- /dev/null
+++ b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/environments.rst
@@ -0,0 +1,11 @@
+Environments
+------------------------------
+
+.. automodule:: google.cloud.dialogflowcx_v3.services.environments
+ :members:
+ :inherited-members:
+
+
+.. automodule:: google.cloud.dialogflowcx_v3.services.environments.pagers
+ :members:
+ :inherited-members:
diff --git a/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/experiments.rst b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/experiments.rst
new file mode 100644
index 000000000000..6f13e0abf850
--- /dev/null
+++ b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/experiments.rst
@@ -0,0 +1,11 @@
+Experiments
+-----------------------------
+
+.. automodule:: google.cloud.dialogflowcx_v3.services.experiments
+ :members:
+ :inherited-members:
+
+
+.. automodule:: google.cloud.dialogflowcx_v3.services.experiments.pagers
+ :members:
+ :inherited-members:
diff --git a/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/flows.rst b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/flows.rst
new file mode 100644
index 000000000000..832a92cd54ff
--- /dev/null
+++ b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/flows.rst
@@ -0,0 +1,11 @@
+Flows
+-----------------------
+
+.. automodule:: google.cloud.dialogflowcx_v3.services.flows
+ :members:
+ :inherited-members:
+
+
+.. automodule:: google.cloud.dialogflowcx_v3.services.flows.pagers
+ :members:
+ :inherited-members:
diff --git a/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/intents.rst b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/intents.rst
new file mode 100644
index 000000000000..e5521b4af863
--- /dev/null
+++ b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/intents.rst
@@ -0,0 +1,11 @@
+Intents
+-------------------------
+
+.. automodule:: google.cloud.dialogflowcx_v3.services.intents
+ :members:
+ :inherited-members:
+
+
+.. automodule:: google.cloud.dialogflowcx_v3.services.intents.pagers
+ :members:
+ :inherited-members:
diff --git a/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/pages.rst b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/pages.rst
new file mode 100644
index 000000000000..6ed56180123c
--- /dev/null
+++ b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/pages.rst
@@ -0,0 +1,11 @@
+Pages
+-----------------------
+
+.. automodule:: google.cloud.dialogflowcx_v3.services.pages
+ :members:
+ :inherited-members:
+
+
+.. automodule:: google.cloud.dialogflowcx_v3.services.pages.pagers
+ :members:
+ :inherited-members:
diff --git a/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/security_settings_service.rst b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/security_settings_service.rst
new file mode 100644
index 000000000000..6e9967b84167
--- /dev/null
+++ b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/security_settings_service.rst
@@ -0,0 +1,11 @@
+SecuritySettingsService
+-----------------------------------------
+
+.. automodule:: google.cloud.dialogflowcx_v3.services.security_settings_service
+ :members:
+ :inherited-members:
+
+
+.. automodule:: google.cloud.dialogflowcx_v3.services.security_settings_service.pagers
+ :members:
+ :inherited-members:
diff --git a/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/services.rst b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/services.rst
index 958aa6851f75..3da663c93f8f 100644
--- a/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/services.rst
+++ b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/services.rst
@@ -1,42 +1,19 @@
Services for Google Cloud Dialogflowcx v3 API
=============================================
+.. toctree::
+ :maxdepth: 2
-.. automodule:: google.cloud.dialogflowcx_v3.services.agents
- :members:
- :inherited-members:
-.. automodule:: google.cloud.dialogflowcx_v3.services.entity_types
- :members:
- :inherited-members:
-.. automodule:: google.cloud.dialogflowcx_v3.services.environments
- :members:
- :inherited-members:
-.. automodule:: google.cloud.dialogflowcx_v3.services.experiments
- :members:
- :inherited-members:
-.. automodule:: google.cloud.dialogflowcx_v3.services.flows
- :members:
- :inherited-members:
-.. automodule:: google.cloud.dialogflowcx_v3.services.intents
- :members:
- :inherited-members:
-.. automodule:: google.cloud.dialogflowcx_v3.services.pages
- :members:
- :inherited-members:
-.. automodule:: google.cloud.dialogflowcx_v3.services.security_settings_service
- :members:
- :inherited-members:
-.. automodule:: google.cloud.dialogflowcx_v3.services.session_entity_types
- :members:
- :inherited-members:
-.. automodule:: google.cloud.dialogflowcx_v3.services.sessions
- :members:
- :inherited-members:
-.. automodule:: google.cloud.dialogflowcx_v3.services.transition_route_groups
- :members:
- :inherited-members:
-.. automodule:: google.cloud.dialogflowcx_v3.services.versions
- :members:
- :inherited-members:
-.. automodule:: google.cloud.dialogflowcx_v3.services.webhooks
- :members:
- :inherited-members:
+ agents
+ entity_types
+ environments
+ experiments
+ flows
+ intents
+ pages
+ security_settings_service
+ session_entity_types
+ sessions
+ test_cases
+ transition_route_groups
+ versions
+ webhooks
diff --git a/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/session_entity_types.rst b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/session_entity_types.rst
new file mode 100644
index 000000000000..d92d0fe5d758
--- /dev/null
+++ b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/session_entity_types.rst
@@ -0,0 +1,11 @@
+SessionEntityTypes
+------------------------------------
+
+.. automodule:: google.cloud.dialogflowcx_v3.services.session_entity_types
+ :members:
+ :inherited-members:
+
+
+.. automodule:: google.cloud.dialogflowcx_v3.services.session_entity_types.pagers
+ :members:
+ :inherited-members:
diff --git a/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/sessions.rst b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/sessions.rst
new file mode 100644
index 000000000000..494bceb1375b
--- /dev/null
+++ b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/sessions.rst
@@ -0,0 +1,6 @@
+Sessions
+--------------------------
+
+.. automodule:: google.cloud.dialogflowcx_v3.services.sessions
+ :members:
+ :inherited-members:
diff --git a/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/test_cases.rst b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/test_cases.rst
new file mode 100644
index 000000000000..ab5a6fbba5f3
--- /dev/null
+++ b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/test_cases.rst
@@ -0,0 +1,11 @@
+TestCases
+---------------------------
+
+.. automodule:: google.cloud.dialogflowcx_v3.services.test_cases
+ :members:
+ :inherited-members:
+
+
+.. automodule:: google.cloud.dialogflowcx_v3.services.test_cases.pagers
+ :members:
+ :inherited-members:
diff --git a/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/transition_route_groups.rst b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/transition_route_groups.rst
new file mode 100644
index 000000000000..437962a62b70
--- /dev/null
+++ b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/transition_route_groups.rst
@@ -0,0 +1,11 @@
+TransitionRouteGroups
+---------------------------------------
+
+.. automodule:: google.cloud.dialogflowcx_v3.services.transition_route_groups
+ :members:
+ :inherited-members:
+
+
+.. automodule:: google.cloud.dialogflowcx_v3.services.transition_route_groups.pagers
+ :members:
+ :inherited-members:
diff --git a/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/types.rst b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/types.rst
index eee8146a1d62..7e2b1c53d8cf 100644
--- a/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/types.rst
+++ b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/types.rst
@@ -3,4 +3,5 @@ Types for Google Cloud Dialogflowcx v3 API
.. automodule:: google.cloud.dialogflowcx_v3.types
:members:
+ :undoc-members:
:show-inheritance:
diff --git a/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/versions.rst b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/versions.rst
new file mode 100644
index 000000000000..10f422b85e08
--- /dev/null
+++ b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/versions.rst
@@ -0,0 +1,11 @@
+Versions
+--------------------------
+
+.. automodule:: google.cloud.dialogflowcx_v3.services.versions
+ :members:
+ :inherited-members:
+
+
+.. automodule:: google.cloud.dialogflowcx_v3.services.versions.pagers
+ :members:
+ :inherited-members:
diff --git a/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/webhooks.rst b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/webhooks.rst
new file mode 100644
index 000000000000..53f893ebcfa6
--- /dev/null
+++ b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/webhooks.rst
@@ -0,0 +1,11 @@
+Webhooks
+--------------------------
+
+.. automodule:: google.cloud.dialogflowcx_v3.services.webhooks
+ :members:
+ :inherited-members:
+
+
+.. automodule:: google.cloud.dialogflowcx_v3.services.webhooks.pagers
+ :members:
+ :inherited-members:
diff --git a/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/agents.rst b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/agents.rst
new file mode 100644
index 000000000000..f1f6e5e99e19
--- /dev/null
+++ b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/agents.rst
@@ -0,0 +1,11 @@
+Agents
+------------------------
+
+.. automodule:: google.cloud.dialogflowcx_v3beta1.services.agents
+ :members:
+ :inherited-members:
+
+
+.. automodule:: google.cloud.dialogflowcx_v3beta1.services.agents.pagers
+ :members:
+ :inherited-members:
diff --git a/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/entity_types.rst b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/entity_types.rst
new file mode 100644
index 000000000000..27814dcd8ff4
--- /dev/null
+++ b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/entity_types.rst
@@ -0,0 +1,11 @@
+EntityTypes
+-----------------------------
+
+.. automodule:: google.cloud.dialogflowcx_v3beta1.services.entity_types
+ :members:
+ :inherited-members:
+
+
+.. automodule:: google.cloud.dialogflowcx_v3beta1.services.entity_types.pagers
+ :members:
+ :inherited-members:
diff --git a/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/environments.rst b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/environments.rst
new file mode 100644
index 000000000000..eeb8ed199f38
--- /dev/null
+++ b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/environments.rst
@@ -0,0 +1,11 @@
+Environments
+------------------------------
+
+.. automodule:: google.cloud.dialogflowcx_v3beta1.services.environments
+ :members:
+ :inherited-members:
+
+
+.. automodule:: google.cloud.dialogflowcx_v3beta1.services.environments.pagers
+ :members:
+ :inherited-members:
diff --git a/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/experiments.rst b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/experiments.rst
new file mode 100644
index 000000000000..fc67280f65d6
--- /dev/null
+++ b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/experiments.rst
@@ -0,0 +1,11 @@
+Experiments
+-----------------------------
+
+.. automodule:: google.cloud.dialogflowcx_v3beta1.services.experiments
+ :members:
+ :inherited-members:
+
+
+.. automodule:: google.cloud.dialogflowcx_v3beta1.services.experiments.pagers
+ :members:
+ :inherited-members:
diff --git a/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/flows.rst b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/flows.rst
new file mode 100644
index 000000000000..ef180beeb04e
--- /dev/null
+++ b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/flows.rst
@@ -0,0 +1,11 @@
+Flows
+-----------------------
+
+.. automodule:: google.cloud.dialogflowcx_v3beta1.services.flows
+ :members:
+ :inherited-members:
+
+
+.. automodule:: google.cloud.dialogflowcx_v3beta1.services.flows.pagers
+ :members:
+ :inherited-members:
diff --git a/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/intents.rst b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/intents.rst
new file mode 100644
index 000000000000..4e4f0077a9fb
--- /dev/null
+++ b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/intents.rst
@@ -0,0 +1,11 @@
+Intents
+-------------------------
+
+.. automodule:: google.cloud.dialogflowcx_v3beta1.services.intents
+ :members:
+ :inherited-members:
+
+
+.. automodule:: google.cloud.dialogflowcx_v3beta1.services.intents.pagers
+ :members:
+ :inherited-members:
diff --git a/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/pages.rst b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/pages.rst
new file mode 100644
index 000000000000..780bcf9772cd
--- /dev/null
+++ b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/pages.rst
@@ -0,0 +1,11 @@
+Pages
+-----------------------
+
+.. automodule:: google.cloud.dialogflowcx_v3beta1.services.pages
+ :members:
+ :inherited-members:
+
+
+.. automodule:: google.cloud.dialogflowcx_v3beta1.services.pages.pagers
+ :members:
+ :inherited-members:
diff --git a/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/security_settings_service.rst b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/security_settings_service.rst
new file mode 100644
index 000000000000..560a33645458
--- /dev/null
+++ b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/security_settings_service.rst
@@ -0,0 +1,11 @@
+SecuritySettingsService
+-----------------------------------------
+
+.. automodule:: google.cloud.dialogflowcx_v3beta1.services.security_settings_service
+ :members:
+ :inherited-members:
+
+
+.. automodule:: google.cloud.dialogflowcx_v3beta1.services.security_settings_service.pagers
+ :members:
+ :inherited-members:
diff --git a/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/services.rst b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/services.rst
index 89e12040e735..03f147db631c 100644
--- a/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/services.rst
+++ b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/services.rst
@@ -1,42 +1,19 @@
Services for Google Cloud Dialogflowcx v3beta1 API
==================================================
+.. toctree::
+ :maxdepth: 2
-.. automodule:: google.cloud.dialogflowcx_v3beta1.services.agents
- :members:
- :inherited-members:
-.. automodule:: google.cloud.dialogflowcx_v3beta1.services.entity_types
- :members:
- :inherited-members:
-.. automodule:: google.cloud.dialogflowcx_v3beta1.services.environments
- :members:
- :inherited-members:
-.. automodule:: google.cloud.dialogflowcx_v3beta1.services.experiments
- :members:
- :inherited-members:
-.. automodule:: google.cloud.dialogflowcx_v3beta1.services.flows
- :members:
- :inherited-members:
-.. automodule:: google.cloud.dialogflowcx_v3beta1.services.intents
- :members:
- :inherited-members:
-.. automodule:: google.cloud.dialogflowcx_v3beta1.services.pages
- :members:
- :inherited-members:
-.. automodule:: google.cloud.dialogflowcx_v3beta1.services.security_settings_service
- :members:
- :inherited-members:
-.. automodule:: google.cloud.dialogflowcx_v3beta1.services.session_entity_types
- :members:
- :inherited-members:
-.. automodule:: google.cloud.dialogflowcx_v3beta1.services.sessions
- :members:
- :inherited-members:
-.. automodule:: google.cloud.dialogflowcx_v3beta1.services.transition_route_groups
- :members:
- :inherited-members:
-.. automodule:: google.cloud.dialogflowcx_v3beta1.services.versions
- :members:
- :inherited-members:
-.. automodule:: google.cloud.dialogflowcx_v3beta1.services.webhooks
- :members:
- :inherited-members:
+ agents
+ entity_types
+ environments
+ experiments
+ flows
+ intents
+ pages
+ security_settings_service
+ session_entity_types
+ sessions
+ test_cases
+ transition_route_groups
+ versions
+ webhooks
diff --git a/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/session_entity_types.rst b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/session_entity_types.rst
new file mode 100644
index 000000000000..b4c42ef96199
--- /dev/null
+++ b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/session_entity_types.rst
@@ -0,0 +1,11 @@
+SessionEntityTypes
+------------------------------------
+
+.. automodule:: google.cloud.dialogflowcx_v3beta1.services.session_entity_types
+ :members:
+ :inherited-members:
+
+
+.. automodule:: google.cloud.dialogflowcx_v3beta1.services.session_entity_types.pagers
+ :members:
+ :inherited-members:
diff --git a/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/sessions.rst b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/sessions.rst
new file mode 100644
index 000000000000..3f792bf8f72c
--- /dev/null
+++ b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/sessions.rst
@@ -0,0 +1,6 @@
+Sessions
+--------------------------
+
+.. automodule:: google.cloud.dialogflowcx_v3beta1.services.sessions
+ :members:
+ :inherited-members:
diff --git a/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/test_cases.rst b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/test_cases.rst
new file mode 100644
index 000000000000..0840b07a061d
--- /dev/null
+++ b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/test_cases.rst
@@ -0,0 +1,11 @@
+TestCases
+---------------------------
+
+.. automodule:: google.cloud.dialogflowcx_v3beta1.services.test_cases
+ :members:
+ :inherited-members:
+
+
+.. automodule:: google.cloud.dialogflowcx_v3beta1.services.test_cases.pagers
+ :members:
+ :inherited-members:
diff --git a/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/transition_route_groups.rst b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/transition_route_groups.rst
new file mode 100644
index 000000000000..894278a4137d
--- /dev/null
+++ b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/transition_route_groups.rst
@@ -0,0 +1,11 @@
+TransitionRouteGroups
+---------------------------------------
+
+.. automodule:: google.cloud.dialogflowcx_v3beta1.services.transition_route_groups
+ :members:
+ :inherited-members:
+
+
+.. automodule:: google.cloud.dialogflowcx_v3beta1.services.transition_route_groups.pagers
+ :members:
+ :inherited-members:
diff --git a/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/types.rst b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/types.rst
index 3c1160db7b56..a7388b279a17 100644
--- a/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/types.rst
+++ b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/types.rst
@@ -3,4 +3,5 @@ Types for Google Cloud Dialogflowcx v3beta1 API
.. automodule:: google.cloud.dialogflowcx_v3beta1.types
:members:
+ :undoc-members:
:show-inheritance:
diff --git a/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/versions.rst b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/versions.rst
new file mode 100644
index 000000000000..c08e348ca04e
--- /dev/null
+++ b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/versions.rst
@@ -0,0 +1,11 @@
+Versions
+--------------------------
+
+.. automodule:: google.cloud.dialogflowcx_v3beta1.services.versions
+ :members:
+ :inherited-members:
+
+
+.. automodule:: google.cloud.dialogflowcx_v3beta1.services.versions.pagers
+ :members:
+ :inherited-members:
diff --git a/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/webhooks.rst b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/webhooks.rst
new file mode 100644
index 000000000000..d5a824520299
--- /dev/null
+++ b/packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3beta1/webhooks.rst
@@ -0,0 +1,11 @@
+Webhooks
+--------------------------
+
+.. automodule:: google.cloud.dialogflowcx_v3beta1.services.webhooks
+ :members:
+ :inherited-members:
+
+
+.. automodule:: google.cloud.dialogflowcx_v3beta1.services.webhooks.pagers
+ :members:
+ :inherited-members:
diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx/__init__.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx/__init__.py
index cc38b578d8bc..cd27a417c29a 100644
--- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx/__init__.py
+++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx/__init__.py
@@ -53,6 +53,10 @@
SessionsAsyncClient,
)
from google.cloud.dialogflowcx_v3.services.sessions.client import SessionsClient
+from google.cloud.dialogflowcx_v3.services.test_cases.async_client import (
+ TestCasesAsyncClient,
+)
+from google.cloud.dialogflowcx_v3.services.test_cases.client import TestCasesClient
from google.cloud.dialogflowcx_v3.services.transition_route_groups.async_client import (
TransitionRouteGroupsAsyncClient,
)
@@ -68,16 +72,19 @@
)
from google.cloud.dialogflowcx_v3.services.webhooks.client import WebhooksClient
from google.cloud.dialogflowcx_v3.types.agent import Agent
+from google.cloud.dialogflowcx_v3.types.agent import AgentValidationResult
from google.cloud.dialogflowcx_v3.types.agent import CreateAgentRequest
from google.cloud.dialogflowcx_v3.types.agent import DeleteAgentRequest
from google.cloud.dialogflowcx_v3.types.agent import ExportAgentRequest
from google.cloud.dialogflowcx_v3.types.agent import ExportAgentResponse
from google.cloud.dialogflowcx_v3.types.agent import GetAgentRequest
+from google.cloud.dialogflowcx_v3.types.agent import GetAgentValidationResultRequest
from google.cloud.dialogflowcx_v3.types.agent import ListAgentsRequest
from google.cloud.dialogflowcx_v3.types.agent import ListAgentsResponse
from google.cloud.dialogflowcx_v3.types.agent import RestoreAgentRequest
from google.cloud.dialogflowcx_v3.types.agent import SpeechToTextSettings
from google.cloud.dialogflowcx_v3.types.agent import UpdateAgentRequest
+from google.cloud.dialogflowcx_v3.types.agent import ValidateAgentRequest
from google.cloud.dialogflowcx_v3.types.audio_config import AudioEncoding
from google.cloud.dialogflowcx_v3.types.audio_config import InputAudioConfig
from google.cloud.dialogflowcx_v3.types.audio_config import OutputAudioConfig
@@ -121,12 +128,15 @@
from google.cloud.dialogflowcx_v3.types.flow import CreateFlowRequest
from google.cloud.dialogflowcx_v3.types.flow import DeleteFlowRequest
from google.cloud.dialogflowcx_v3.types.flow import Flow
+from google.cloud.dialogflowcx_v3.types.flow import FlowValidationResult
from google.cloud.dialogflowcx_v3.types.flow import GetFlowRequest
+from google.cloud.dialogflowcx_v3.types.flow import GetFlowValidationResultRequest
from google.cloud.dialogflowcx_v3.types.flow import ListFlowsRequest
from google.cloud.dialogflowcx_v3.types.flow import ListFlowsResponse
from google.cloud.dialogflowcx_v3.types.flow import NluSettings
from google.cloud.dialogflowcx_v3.types.flow import TrainFlowRequest
from google.cloud.dialogflowcx_v3.types.flow import UpdateFlowRequest
+from google.cloud.dialogflowcx_v3.types.flow import ValidateFlowRequest
from google.cloud.dialogflowcx_v3.types.fulfillment import Fulfillment
from google.cloud.dialogflowcx_v3.types.intent import CreateIntentRequest
from google.cloud.dialogflowcx_v3.types.intent import DeleteIntentRequest
@@ -204,6 +214,39 @@
from google.cloud.dialogflowcx_v3.types.session_entity_type import (
UpdateSessionEntityTypeRequest,
)
+from google.cloud.dialogflowcx_v3.types.test_case import BatchDeleteTestCasesRequest
+from google.cloud.dialogflowcx_v3.types.test_case import BatchRunTestCasesMetadata
+from google.cloud.dialogflowcx_v3.types.test_case import BatchRunTestCasesRequest
+from google.cloud.dialogflowcx_v3.types.test_case import BatchRunTestCasesResponse
+from google.cloud.dialogflowcx_v3.types.test_case import CalculateCoverageRequest
+from google.cloud.dialogflowcx_v3.types.test_case import CalculateCoverageResponse
+from google.cloud.dialogflowcx_v3.types.test_case import ConversationTurn
+from google.cloud.dialogflowcx_v3.types.test_case import CreateTestCaseRequest
+from google.cloud.dialogflowcx_v3.types.test_case import ExportTestCasesMetadata
+from google.cloud.dialogflowcx_v3.types.test_case import ExportTestCasesRequest
+from google.cloud.dialogflowcx_v3.types.test_case import ExportTestCasesResponse
+from google.cloud.dialogflowcx_v3.types.test_case import GetTestCaseRequest
+from google.cloud.dialogflowcx_v3.types.test_case import ImportTestCasesMetadata
+from google.cloud.dialogflowcx_v3.types.test_case import ImportTestCasesRequest
+from google.cloud.dialogflowcx_v3.types.test_case import ImportTestCasesResponse
+from google.cloud.dialogflowcx_v3.types.test_case import IntentCoverage
+from google.cloud.dialogflowcx_v3.types.test_case import ListTestCaseResultsRequest
+from google.cloud.dialogflowcx_v3.types.test_case import ListTestCaseResultsResponse
+from google.cloud.dialogflowcx_v3.types.test_case import ListTestCasesRequest
+from google.cloud.dialogflowcx_v3.types.test_case import ListTestCasesResponse
+from google.cloud.dialogflowcx_v3.types.test_case import RunTestCaseMetadata
+from google.cloud.dialogflowcx_v3.types.test_case import RunTestCaseRequest
+from google.cloud.dialogflowcx_v3.types.test_case import RunTestCaseResponse
+from google.cloud.dialogflowcx_v3.types.test_case import TestCase
+from google.cloud.dialogflowcx_v3.types.test_case import TestCaseError
+from google.cloud.dialogflowcx_v3.types.test_case import TestCaseResult
+from google.cloud.dialogflowcx_v3.types.test_case import TestConfig
+from google.cloud.dialogflowcx_v3.types.test_case import TestError
+from google.cloud.dialogflowcx_v3.types.test_case import TestResult
+from google.cloud.dialogflowcx_v3.types.test_case import TestRunDifference
+from google.cloud.dialogflowcx_v3.types.test_case import TransitionCoverage
+from google.cloud.dialogflowcx_v3.types.test_case import TransitionRouteGroupCoverage
+from google.cloud.dialogflowcx_v3.types.test_case import UpdateTestCaseRequest
from google.cloud.dialogflowcx_v3.types.transition_route_group import (
CreateTransitionRouteGroupRequest,
)
@@ -225,6 +268,8 @@
from google.cloud.dialogflowcx_v3.types.transition_route_group import (
UpdateTransitionRouteGroupRequest,
)
+from google.cloud.dialogflowcx_v3.types.validation_message import ResourceName
+from google.cloud.dialogflowcx_v3.types.validation_message import ValidationMessage
from google.cloud.dialogflowcx_v3.types.version import CreateVersionOperationMetadata
from google.cloud.dialogflowcx_v3.types.version import CreateVersionRequest
from google.cloud.dialogflowcx_v3.types.version import DeleteVersionRequest
@@ -248,10 +293,18 @@
__all__ = (
"Agent",
+ "AgentValidationResult",
"AgentsAsyncClient",
"AgentsClient",
"AudioEncoding",
"AudioInput",
+ "BatchDeleteTestCasesRequest",
+ "BatchRunTestCasesMetadata",
+ "BatchRunTestCasesRequest",
+ "BatchRunTestCasesResponse",
+ "CalculateCoverageRequest",
+ "CalculateCoverageResponse",
+ "ConversationTurn",
"CreateAgentRequest",
"CreateEntityTypeRequest",
"CreateEnvironmentRequest",
@@ -261,6 +314,7 @@
"CreatePageRequest",
"CreateSecuritySettingsRequest",
"CreateSessionEntityTypeRequest",
+ "CreateTestCaseRequest",
"CreateTransitionRouteGroupRequest",
"CreateVersionOperationMetadata",
"CreateVersionRequest",
@@ -293,7 +347,11 @@
"ExperimentsClient",
"ExportAgentRequest",
"ExportAgentResponse",
+ "ExportTestCasesMetadata",
+ "ExportTestCasesRequest",
+ "ExportTestCasesResponse",
"Flow",
+ "FlowValidationResult",
"FlowsAsyncClient",
"FlowsClient",
"Form",
@@ -301,19 +359,26 @@
"FulfillIntentResponse",
"Fulfillment",
"GetAgentRequest",
+ "GetAgentValidationResultRequest",
"GetEntityTypeRequest",
"GetEnvironmentRequest",
"GetExperimentRequest",
"GetFlowRequest",
+ "GetFlowValidationResultRequest",
"GetIntentRequest",
"GetPageRequest",
"GetSecuritySettingsRequest",
"GetSessionEntityTypeRequest",
+ "GetTestCaseRequest",
"GetTransitionRouteGroupRequest",
"GetVersionRequest",
"GetWebhookRequest",
+ "ImportTestCasesMetadata",
+ "ImportTestCasesRequest",
+ "ImportTestCasesResponse",
"InputAudioConfig",
"Intent",
+ "IntentCoverage",
"IntentInput",
"IntentView",
"IntentsAsyncClient",
@@ -336,6 +401,10 @@
"ListSecuritySettingsResponse",
"ListSessionEntityTypesRequest",
"ListSessionEntityTypesResponse",
+ "ListTestCaseResultsRequest",
+ "ListTestCaseResultsResponse",
+ "ListTestCasesRequest",
+ "ListTestCasesResponse",
"ListTransitionRouteGroupsRequest",
"ListTransitionRouteGroupsResponse",
"ListVersionsRequest",
@@ -358,8 +427,12 @@
"QueryInput",
"QueryParameters",
"QueryResult",
+ "ResourceName",
"ResponseMessage",
"RestoreAgentRequest",
+ "RunTestCaseMetadata",
+ "RunTestCaseRequest",
+ "RunTestCaseResponse",
"SecuritySettings",
"SecuritySettingsServiceAsyncClient",
"SecuritySettingsServiceClient",
@@ -380,10 +453,21 @@
"StreamingDetectIntentResponse",
"StreamingRecognitionResult",
"SynthesizeSpeechConfig",
+ "TestCase",
+ "TestCaseError",
+ "TestCaseResult",
+ "TestCasesAsyncClient",
+ "TestCasesClient",
+ "TestConfig",
+ "TestError",
+ "TestResult",
+ "TestRunDifference",
"TextInput",
"TrainFlowRequest",
+ "TransitionCoverage",
"TransitionRoute",
"TransitionRouteGroup",
+ "TransitionRouteGroupCoverage",
"TransitionRouteGroupsAsyncClient",
"TransitionRouteGroupsClient",
"UpdateAgentRequest",
@@ -395,9 +479,13 @@
"UpdatePageRequest",
"UpdateSecuritySettingsRequest",
"UpdateSessionEntityTypeRequest",
+ "UpdateTestCaseRequest",
"UpdateTransitionRouteGroupRequest",
"UpdateVersionRequest",
"UpdateWebhookRequest",
+ "ValidateAgentRequest",
+ "ValidateFlowRequest",
+ "ValidationMessage",
"VariantsHistory",
"Version",
"VersionVariants",
diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/__init__.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/__init__.py
index a897ab89873e..b85b6810e7dc 100644
--- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/__init__.py
+++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/__init__.py
@@ -25,20 +25,24 @@
from .services.security_settings_service import SecuritySettingsServiceClient
from .services.session_entity_types import SessionEntityTypesClient
from .services.sessions import SessionsClient
+from .services.test_cases import TestCasesClient
from .services.transition_route_groups import TransitionRouteGroupsClient
from .services.versions import VersionsClient
from .services.webhooks import WebhooksClient
from .types.agent import Agent
+from .types.agent import AgentValidationResult
from .types.agent import CreateAgentRequest
from .types.agent import DeleteAgentRequest
from .types.agent import ExportAgentRequest
from .types.agent import ExportAgentResponse
from .types.agent import GetAgentRequest
+from .types.agent import GetAgentValidationResultRequest
from .types.agent import ListAgentsRequest
from .types.agent import ListAgentsResponse
from .types.agent import RestoreAgentRequest
from .types.agent import SpeechToTextSettings
from .types.agent import UpdateAgentRequest
+from .types.agent import ValidateAgentRequest
from .types.audio_config import AudioEncoding
from .types.audio_config import InputAudioConfig
from .types.audio_config import OutputAudioConfig
@@ -78,12 +82,15 @@
from .types.flow import CreateFlowRequest
from .types.flow import DeleteFlowRequest
from .types.flow import Flow
+from .types.flow import FlowValidationResult
from .types.flow import GetFlowRequest
+from .types.flow import GetFlowValidationResultRequest
from .types.flow import ListFlowsRequest
from .types.flow import ListFlowsResponse
from .types.flow import NluSettings
from .types.flow import TrainFlowRequest
from .types.flow import UpdateFlowRequest
+from .types.flow import ValidateFlowRequest
from .types.fulfillment import Fulfillment
from .types.intent import CreateIntentRequest
from .types.intent import DeleteIntentRequest
@@ -137,6 +144,39 @@
from .types.session_entity_type import ListSessionEntityTypesResponse
from .types.session_entity_type import SessionEntityType
from .types.session_entity_type import UpdateSessionEntityTypeRequest
+from .types.test_case import BatchDeleteTestCasesRequest
+from .types.test_case import BatchRunTestCasesMetadata
+from .types.test_case import BatchRunTestCasesRequest
+from .types.test_case import BatchRunTestCasesResponse
+from .types.test_case import CalculateCoverageRequest
+from .types.test_case import CalculateCoverageResponse
+from .types.test_case import ConversationTurn
+from .types.test_case import CreateTestCaseRequest
+from .types.test_case import ExportTestCasesMetadata
+from .types.test_case import ExportTestCasesRequest
+from .types.test_case import ExportTestCasesResponse
+from .types.test_case import GetTestCaseRequest
+from .types.test_case import ImportTestCasesMetadata
+from .types.test_case import ImportTestCasesRequest
+from .types.test_case import ImportTestCasesResponse
+from .types.test_case import IntentCoverage
+from .types.test_case import ListTestCaseResultsRequest
+from .types.test_case import ListTestCaseResultsResponse
+from .types.test_case import ListTestCasesRequest
+from .types.test_case import ListTestCasesResponse
+from .types.test_case import RunTestCaseMetadata
+from .types.test_case import RunTestCaseRequest
+from .types.test_case import RunTestCaseResponse
+from .types.test_case import TestCase
+from .types.test_case import TestCaseError
+from .types.test_case import TestCaseResult
+from .types.test_case import TestConfig
+from .types.test_case import TestError
+from .types.test_case import TestResult
+from .types.test_case import TestRunDifference
+from .types.test_case import TransitionCoverage
+from .types.test_case import TransitionRouteGroupCoverage
+from .types.test_case import UpdateTestCaseRequest
from .types.transition_route_group import CreateTransitionRouteGroupRequest
from .types.transition_route_group import DeleteTransitionRouteGroupRequest
from .types.transition_route_group import GetTransitionRouteGroupRequest
@@ -144,6 +184,8 @@
from .types.transition_route_group import ListTransitionRouteGroupsResponse
from .types.transition_route_group import TransitionRouteGroup
from .types.transition_route_group import UpdateTransitionRouteGroupRequest
+from .types.validation_message import ResourceName
+from .types.validation_message import ValidationMessage
from .types.version import CreateVersionOperationMetadata
from .types.version import CreateVersionRequest
from .types.version import DeleteVersionRequest
@@ -168,9 +210,17 @@
__all__ = (
"Agent",
+ "AgentValidationResult",
"AgentsClient",
"AudioEncoding",
"AudioInput",
+ "BatchDeleteTestCasesRequest",
+ "BatchRunTestCasesMetadata",
+ "BatchRunTestCasesRequest",
+ "BatchRunTestCasesResponse",
+ "CalculateCoverageRequest",
+ "CalculateCoverageResponse",
+ "ConversationTurn",
"CreateAgentRequest",
"CreateEntityTypeRequest",
"CreateEnvironmentRequest",
@@ -180,6 +230,7 @@
"CreatePageRequest",
"CreateSecuritySettingsRequest",
"CreateSessionEntityTypeRequest",
+ "CreateTestCaseRequest",
"CreateTransitionRouteGroupRequest",
"CreateVersionOperationMetadata",
"CreateVersionRequest",
@@ -200,6 +251,7 @@
"DetectIntentResponse",
"DtmfInput",
"EntityType",
+ "EntityTypesClient",
"Environment",
"EnvironmentsClient",
"EventHandler",
@@ -208,26 +260,37 @@
"ExperimentsClient",
"ExportAgentRequest",
"ExportAgentResponse",
+ "ExportTestCasesMetadata",
+ "ExportTestCasesRequest",
+ "ExportTestCasesResponse",
"Flow",
+ "FlowValidationResult",
"FlowsClient",
"Form",
"FulfillIntentRequest",
"FulfillIntentResponse",
"Fulfillment",
"GetAgentRequest",
+ "GetAgentValidationResultRequest",
"GetEntityTypeRequest",
"GetEnvironmentRequest",
"GetExperimentRequest",
"GetFlowRequest",
+ "GetFlowValidationResultRequest",
"GetIntentRequest",
"GetPageRequest",
"GetSecuritySettingsRequest",
"GetSessionEntityTypeRequest",
+ "GetTestCaseRequest",
"GetTransitionRouteGroupRequest",
"GetVersionRequest",
"GetWebhookRequest",
+ "ImportTestCasesMetadata",
+ "ImportTestCasesRequest",
+ "ImportTestCasesResponse",
"InputAudioConfig",
"Intent",
+ "IntentCoverage",
"IntentInput",
"IntentView",
"IntentsClient",
@@ -249,6 +312,10 @@
"ListSecuritySettingsResponse",
"ListSessionEntityTypesRequest",
"ListSessionEntityTypesResponse",
+ "ListTestCaseResultsRequest",
+ "ListTestCaseResultsResponse",
+ "ListTestCasesRequest",
+ "ListTestCasesResponse",
"ListTransitionRouteGroupsRequest",
"ListTransitionRouteGroupsResponse",
"ListVersionsRequest",
@@ -270,8 +337,12 @@
"QueryInput",
"QueryParameters",
"QueryResult",
+ "ResourceName",
"ResponseMessage",
"RestoreAgentRequest",
+ "RunTestCaseMetadata",
+ "RunTestCaseRequest",
+ "RunTestCaseResponse",
"SecuritySettings",
"SecuritySettingsServiceClient",
"SentimentAnalysisResult",
@@ -289,10 +360,21 @@
"StreamingDetectIntentResponse",
"StreamingRecognitionResult",
"SynthesizeSpeechConfig",
+ "TestCase",
+ "TestCaseError",
+ "TestCaseResult",
+ "TestCasesClient",
+ "TestConfig",
+ "TestError",
+ "TestResult",
+ "TestRunDifference",
"TextInput",
"TrainFlowRequest",
+ "TransitionCoverage",
"TransitionRoute",
"TransitionRouteGroup",
+ "TransitionRouteGroupCoverage",
+ "TransitionRouteGroupsClient",
"UpdateAgentRequest",
"UpdateEntityTypeRequest",
"UpdateEnvironmentRequest",
@@ -302,9 +384,13 @@
"UpdatePageRequest",
"UpdateSecuritySettingsRequest",
"UpdateSessionEntityTypeRequest",
+ "UpdateTestCaseRequest",
"UpdateTransitionRouteGroupRequest",
"UpdateVersionRequest",
"UpdateWebhookRequest",
+ "ValidateAgentRequest",
+ "ValidateFlowRequest",
+ "ValidationMessage",
"VariantsHistory",
"Version",
"VersionVariants",
@@ -314,6 +400,4 @@
"WebhookRequest",
"WebhookResponse",
"WebhooksClient",
- "EntityTypesClient",
- "TransitionRouteGroupsClient",
)
diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/agents/async_client.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/agents/async_client.py
index 49935e19fba9..2dcd732ca1d3 100644
--- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/agents/async_client.py
+++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/agents/async_client.py
@@ -33,6 +33,7 @@
from google.cloud.dialogflowcx_v3.services.agents import pagers
from google.cloud.dialogflowcx_v3.types import agent
from google.cloud.dialogflowcx_v3.types import agent as gcdc_agent
+from google.cloud.dialogflowcx_v3.types import flow
from google.protobuf import empty_pb2 as empty # type: ignore
from google.protobuf import field_mask_pb2 as field_mask # type: ignore
from google.protobuf import struct_pb2 as struct # type: ignore
@@ -52,8 +53,22 @@ class AgentsAsyncClient:
agent_path = staticmethod(AgentsClient.agent_path)
parse_agent_path = staticmethod(AgentsClient.parse_agent_path)
+ agent_validation_result_path = staticmethod(
+ AgentsClient.agent_validation_result_path
+ )
+ parse_agent_validation_result_path = staticmethod(
+ AgentsClient.parse_agent_validation_result_path
+ )
flow_path = staticmethod(AgentsClient.flow_path)
parse_flow_path = staticmethod(AgentsClient.parse_flow_path)
+ flow_validation_result_path = staticmethod(AgentsClient.flow_validation_result_path)
+ parse_flow_validation_result_path = staticmethod(
+ AgentsClient.parse_flow_validation_result_path
+ )
+ security_settings_path = staticmethod(AgentsClient.security_settings_path)
+ parse_security_settings_path = staticmethod(
+ AgentsClient.parse_security_settings_path
+ )
common_billing_account_path = staticmethod(AgentsClient.common_billing_account_path)
parse_common_billing_account_path = staticmethod(
@@ -74,7 +89,36 @@ class AgentsAsyncClient:
common_location_path = staticmethod(AgentsClient.common_location_path)
parse_common_location_path = staticmethod(AgentsClient.parse_common_location_path)
- from_service_account_file = AgentsClient.from_service_account_file
+ @classmethod
+ def from_service_account_info(cls, info: dict, *args, **kwargs):
+ """Creates an instance of this client using the provided credentials info.
+
+ Args:
+ info (dict): The service account private key info.
+ args: Additional arguments to pass to the constructor.
+ kwargs: Additional arguments to pass to the constructor.
+
+ Returns:
+ AgentsAsyncClient: The constructed client.
+ """
+ return AgentsClient.from_service_account_info.__func__(AgentsAsyncClient, info, *args, **kwargs) # type: ignore
+
+ @classmethod
+ def from_service_account_file(cls, filename: str, *args, **kwargs):
+ """Creates an instance of this client using the provided credentials
+ file.
+
+ Args:
+ filename (str): The path to the service account private key json
+ file.
+ args: Additional arguments to pass to the constructor.
+ kwargs: Additional arguments to pass to the constructor.
+
+ Returns:
+ AgentsAsyncClient: The constructed client.
+ """
+ return AgentsClient.from_service_account_file.__func__(AgentsAsyncClient, filename, *args, **kwargs) # type: ignore
+
from_service_account_json = from_service_account_file
@property
@@ -151,12 +195,13 @@ async def list_agents(
location.
Args:
- request (:class:`~.agent.ListAgentsRequest`):
+ request (:class:`google.cloud.dialogflowcx_v3.types.ListAgentsRequest`):
The request object. The request message for
[Agents.ListAgents][google.cloud.dialogflow.cx.v3.Agents.ListAgents].
parent (:class:`str`):
Required. The location to list all agents for. Format:
``projects//locations/``.
+
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -168,7 +213,7 @@ async def list_agents(
sent along with the request as metadata.
Returns:
- ~.pagers.ListAgentsAsyncPager:
+ google.cloud.dialogflowcx_v3.services.agents.pagers.ListAgentsAsyncPager:
The response message for
[Agents.ListAgents][google.cloud.dialogflow.cx.v3.Agents.ListAgents].
@@ -232,12 +277,13 @@ async def get_agent(
r"""Retrieves the specified agent.
Args:
- request (:class:`~.agent.GetAgentRequest`):
+ request (:class:`google.cloud.dialogflowcx_v3.types.GetAgentRequest`):
The request object. The request message for
[Agents.GetAgent][google.cloud.dialogflow.cx.v3.Agents.GetAgent].
name (:class:`str`):
Required. The name of the agent. Format:
``projects//locations//agents/``.
+
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -249,20 +295,21 @@ async def get_agent(
sent along with the request as metadata.
Returns:
- ~.agent.Agent:
- 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], and
- so on to manage the conversation flows..
+ google.cloud.dialogflowcx_v3.types.Agent:
+ 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],
+ and so on to manage the conversation flows..
"""
# Create or coerce a protobuf request object.
@@ -316,16 +363,17 @@ async def create_agent(
r"""Creates an agent in the specified location.
Args:
- request (:class:`~.gcdc_agent.CreateAgentRequest`):
+ request (:class:`google.cloud.dialogflowcx_v3.types.CreateAgentRequest`):
The request object. The request message for
[Agents.CreateAgent][google.cloud.dialogflow.cx.v3.Agents.CreateAgent].
parent (:class:`str`):
Required. The location to create a agent for. Format:
``projects//locations/``.
+
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
- agent (:class:`~.gcdc_agent.Agent`):
+ agent (:class:`google.cloud.dialogflowcx_v3.types.Agent`):
Required. The agent to create.
This corresponds to the ``agent`` field
on the ``request`` instance; if ``request`` is provided, this
@@ -338,20 +386,21 @@ async def create_agent(
sent along with the request as metadata.
Returns:
- ~.gcdc_agent.Agent:
- 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], and
- so on to manage the conversation flows..
+ google.cloud.dialogflowcx_v3.types.Agent:
+ 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],
+ and so on to manage the conversation flows..
"""
# Create or coerce a protobuf request object.
@@ -407,18 +456,19 @@ async def update_agent(
r"""Updates the specified agent.
Args:
- request (:class:`~.gcdc_agent.UpdateAgentRequest`):
+ request (:class:`google.cloud.dialogflowcx_v3.types.UpdateAgentRequest`):
The request object. The request message for
[Agents.UpdateAgent][google.cloud.dialogflow.cx.v3.Agents.UpdateAgent].
- agent (:class:`~.gcdc_agent.Agent`):
+ agent (:class:`google.cloud.dialogflowcx_v3.types.Agent`):
Required. The agent to update.
This corresponds to the ``agent`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
- update_mask (:class:`~.field_mask.FieldMask`):
+ update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`):
The mask to control which fields get
updated. If the mask is not present, all
fields will be updated.
+
This corresponds to the ``update_mask`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -430,20 +480,21 @@ async def update_agent(
sent along with the request as metadata.
Returns:
- ~.gcdc_agent.Agent:
- 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], and
- so on to manage the conversation flows..
+ google.cloud.dialogflowcx_v3.types.Agent:
+ 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],
+ and so on to manage the conversation flows..
"""
# Create or coerce a protobuf request object.
@@ -500,12 +551,13 @@ async def delete_agent(
r"""Deletes the specified agent.
Args:
- request (:class:`~.agent.DeleteAgentRequest`):
+ request (:class:`google.cloud.dialogflowcx_v3.types.DeleteAgentRequest`):
The request object. The request message for
[Agents.DeleteAgent][google.cloud.dialogflow.cx.v3.Agents.DeleteAgent].
name (:class:`str`):
Required. The name of the agent to delete. Format:
``projects//locations//agents/``.
+
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -564,7 +616,7 @@ async def export_agent(
r"""Exports the specified agent to a binary file.
Args:
- request (:class:`~.agent.ExportAgentRequest`):
+ request (:class:`google.cloud.dialogflowcx_v3.types.ExportAgentRequest`):
The request object. The request message for
[Agents.ExportAgent][google.cloud.dialogflow.cx.v3.Agents.ExportAgent].
@@ -575,12 +627,12 @@ async def export_agent(
sent along with the request as metadata.
Returns:
- ~.operation_async.AsyncOperation:
+ google.api_core.operation_async.AsyncOperation:
An object representing a long-running operation.
The result type for the operation will be
- :class:``~.agent.ExportAgentResponse``: The response
- message for
+ :class:`google.cloud.dialogflowcx_v3.types.ExportAgentResponse`
+ The response message for
[Agents.ExportAgent][google.cloud.dialogflow.cx.v3.Agents.ExportAgent].
"""
@@ -630,7 +682,7 @@ async def restore_agent(
flows) will be removed.
Args:
- request (:class:`~.agent.RestoreAgentRequest`):
+ request (:class:`google.cloud.dialogflowcx_v3.types.RestoreAgentRequest`):
The request object. The request message for
[Agents.RestoreAgent][google.cloud.dialogflow.cx.v3.Agents.RestoreAgent].
@@ -641,24 +693,22 @@ async def restore_agent(
sent along with the request as metadata.
Returns:
- ~.operation_async.AsyncOperation:
+ google.api_core.operation_async.AsyncOperation:
An object representing a long-running operation.
- The result type for the operation will be
- :class:``~.empty.Empty``: A generic empty message that
- you can re-use to avoid defining duplicated empty
- messages in your APIs. A typical example is to use it as
- the request or the response type of an API method. For
- instance:
+ The result type for the operation will be :class:`google.protobuf.empty_pb2.Empty` A generic empty message that you can re-use to avoid defining duplicated
+ empty messages in your APIs. A typical example is to
+ use it as the request or the response type of an API
+ method. For instance:
- ::
+ service Foo {
+ rpc Bar(google.protobuf.Empty) returns
+ (google.protobuf.Empty);
- service Foo {
- rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
- }
+ }
- The JSON representation for ``Empty`` is empty JSON
- object ``{}``.
+ The JSON representation for Empty is empty JSON
+ object {}.
"""
# Create or coerce a protobuf request object.
@@ -693,6 +743,134 @@ async def restore_agent(
# Done; return the response.
return response
+ async def validate_agent(
+ self,
+ request: agent.ValidateAgentRequest = None,
+ *,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> agent.AgentValidationResult:
+ r"""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.
+
+ Args:
+ request (:class:`google.cloud.dialogflowcx_v3.types.ValidateAgentRequest`):
+ The request object. The request message for
+ [Agents.ValidateAgent][google.cloud.dialogflow.cx.v3.Agents.ValidateAgent].
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ google.cloud.dialogflowcx_v3.types.AgentValidationResult:
+ The response message for
+ [Agents.GetAgentValidationResult][google.cloud.dialogflow.cx.v3.Agents.GetAgentValidationResult].
+
+ """
+ # Create or coerce a protobuf request object.
+
+ request = agent.ValidateAgentRequest(request)
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method_async.wrap_method(
+ self._client._transport.validate_agent,
+ default_timeout=None,
+ client_info=DEFAULT_CLIENT_INFO,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ async def get_agent_validation_result(
+ self,
+ request: agent.GetAgentValidationResultRequest = None,
+ *,
+ name: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> agent.AgentValidationResult:
+ r"""Gets the latest agent validation result. Agent
+ validation is performed when ValidateAgent is called.
+
+ Args:
+ request (:class:`google.cloud.dialogflowcx_v3.types.GetAgentValidationResultRequest`):
+ The request object. The request message for
+ [Agents.GetAgentValidationResult][google.cloud.dialogflow.cx.v3.Agents.GetAgentValidationResult].
+ name (:class:`str`):
+ Required. The agent name. Format:
+ ``projects//locations//agents//validationResult``.
+
+ This corresponds to the ``name`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ google.cloud.dialogflowcx_v3.types.AgentValidationResult:
+ The response message for
+ [Agents.GetAgentValidationResult][google.cloud.dialogflow.cx.v3.Agents.GetAgentValidationResult].
+
+ """
+ # Create or coerce a protobuf request object.
+ # Sanity check: If we got a request object, we should *not* have
+ # gotten any keyword arguments that map to the request.
+ has_flattened_params = any([name])
+ if request is not None and has_flattened_params:
+ raise ValueError(
+ "If the `request` argument is set, then none of "
+ "the individual field arguments should be set."
+ )
+
+ request = agent.GetAgentValidationResultRequest(request)
+
+ # If we have keyword arguments corresponding to fields on the
+ # request, apply these.
+
+ if name is not None:
+ request.name = name
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method_async.wrap_method(
+ self._client._transport.get_agent_validation_result,
+ default_timeout=None,
+ client_info=DEFAULT_CLIENT_INFO,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
try:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/agents/client.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/agents/client.py
index 67b8d2e78f03..8ebc02b789b6 100644
--- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/agents/client.py
+++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/agents/client.py
@@ -37,6 +37,7 @@
from google.cloud.dialogflowcx_v3.services.agents import pagers
from google.cloud.dialogflowcx_v3.types import agent
from google.cloud.dialogflowcx_v3.types import agent as gcdc_agent
+from google.cloud.dialogflowcx_v3.types import flow
from google.protobuf import empty_pb2 as empty # type: ignore
from google.protobuf import field_mask_pb2 as field_mask # type: ignore
from google.protobuf import struct_pb2 as struct # type: ignore
@@ -114,6 +115,22 @@ def _get_default_mtls_endpoint(api_endpoint):
DEFAULT_ENDPOINT
)
+ @classmethod
+ def from_service_account_info(cls, info: dict, *args, **kwargs):
+ """Creates an instance of this client using the provided credentials info.
+
+ Args:
+ info (dict): The service account private key info.
+ args: Additional arguments to pass to the constructor.
+ kwargs: Additional arguments to pass to the constructor.
+
+ Returns:
+ AgentsClient: The constructed client.
+ """
+ credentials = service_account.Credentials.from_service_account_info(info)
+ kwargs["credentials"] = credentials
+ return cls(*args, **kwargs)
+
@classmethod
def from_service_account_file(cls, filename: str, *args, **kwargs):
"""Creates an instance of this client using the provided credentials
@@ -126,7 +143,7 @@ def from_service_account_file(cls, filename: str, *args, **kwargs):
kwargs: Additional arguments to pass to the constructor.
Returns:
- {@api.name}: The constructed client.
+ AgentsClient: The constructed client.
"""
credentials = service_account.Credentials.from_service_account_file(filename)
kwargs["credentials"] = credentials
@@ -159,6 +176,22 @@ def parse_agent_path(path: str) -> Dict[str, str]:
)
return m.groupdict() if m else {}
+ @staticmethod
+ def agent_validation_result_path(project: str, location: str, agent: str,) -> str:
+ """Return a fully-qualified agent_validation_result string."""
+ return "projects/{project}/locations/{location}/agents/{agent}/validationResult".format(
+ project=project, location=location, agent=agent,
+ )
+
+ @staticmethod
+ def parse_agent_validation_result_path(path: str) -> Dict[str, str]:
+ """Parse a agent_validation_result path into its component segments."""
+ m = re.match(
+ r"^projects/(?P.+?)/locations/(?P.+?)/agents/(?P.+?)/validationResult$",
+ path,
+ )
+ return m.groupdict() if m else {}
+
@staticmethod
def flow_path(project: str, location: str, agent: str, flow: str,) -> str:
"""Return a fully-qualified flow string."""
@@ -175,6 +208,42 @@ def parse_flow_path(path: str) -> Dict[str, str]:
)
return m.groupdict() if m else {}
+ @staticmethod
+ def flow_validation_result_path(
+ project: str, location: str, agent: str, flow: str,
+ ) -> str:
+ """Return a fully-qualified flow_validation_result string."""
+ return "projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult".format(
+ project=project, location=location, agent=agent, flow=flow,
+ )
+
+ @staticmethod
+ def parse_flow_validation_result_path(path: str) -> Dict[str, str]:
+ """Parse a flow_validation_result path into its component segments."""
+ m = re.match(
+ r"^projects/(?P.+?)/locations/(?P.+?)/agents/(?P.+?)/flows/(?P.+?)/validationResult$",
+ path,
+ )
+ return m.groupdict() if m else {}
+
+ @staticmethod
+ def security_settings_path(
+ project: str, location: str, security_settings: str,
+ ) -> str:
+ """Return a fully-qualified security_settings string."""
+ return "projects/{project}/locations/{location}/securitySettings/{security_settings}".format(
+ project=project, location=location, security_settings=security_settings,
+ )
+
+ @staticmethod
+ def parse_security_settings_path(path: str) -> Dict[str, str]:
+ """Parse a security_settings path into its component segments."""
+ m = re.match(
+ r"^projects/(?P.+?)/locations/(?P.+?)/securitySettings/(?P.+?)$",
+ path,
+ )
+ return m.groupdict() if m else {}
+
@staticmethod
def common_billing_account_path(billing_account: str,) -> str:
"""Return a fully-qualified billing_account string."""
@@ -250,10 +319,10 @@ def __init__(
credentials identify the application to the service; if none
are specified, the client will attempt to ascertain the
credentials from the environment.
- transport (Union[str, ~.AgentsTransport]): The
+ transport (Union[str, AgentsTransport]): The
transport to use. If set to None, a transport is chosen
automatically.
- client_options (client_options_lib.ClientOptions): Custom options for the
+ client_options (google.api_core.client_options.ClientOptions): Custom options for the
client. It won't take effect if a ``transport`` instance is provided.
(1) The ``api_endpoint`` property can be used to override the
default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT
@@ -289,21 +358,17 @@ def __init__(
util.strtobool(os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false"))
)
- ssl_credentials = None
+ client_cert_source_func = None
is_mtls = False
if use_client_cert:
if client_options.client_cert_source:
- import grpc # type: ignore
-
- cert, key = client_options.client_cert_source()
- ssl_credentials = grpc.ssl_channel_credentials(
- certificate_chain=cert, private_key=key
- )
is_mtls = True
+ client_cert_source_func = client_options.client_cert_source
else:
- creds = SslCredentials()
- is_mtls = creds.is_mtls
- ssl_credentials = creds.ssl_credentials if is_mtls else None
+ is_mtls = mtls.has_default_client_cert_source()
+ client_cert_source_func = (
+ mtls.default_client_cert_source() if is_mtls else None
+ )
# Figure out which api endpoint to use.
if client_options.api_endpoint is not None:
@@ -346,7 +411,7 @@ def __init__(
credentials_file=client_options.credentials_file,
host=api_endpoint,
scopes=client_options.scopes,
- ssl_channel_credentials=ssl_credentials,
+ client_cert_source_for_mtls=client_cert_source_func,
quota_project_id=client_options.quota_project_id,
client_info=client_info,
)
@@ -364,12 +429,13 @@ def list_agents(
location.
Args:
- request (:class:`~.agent.ListAgentsRequest`):
+ request (google.cloud.dialogflowcx_v3.types.ListAgentsRequest):
The request object. The request message for
[Agents.ListAgents][google.cloud.dialogflow.cx.v3.Agents.ListAgents].
- parent (:class:`str`):
+ parent (str):
Required. The location to list all agents for. Format:
``projects//locations/``.
+
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -381,7 +447,7 @@ def list_agents(
sent along with the request as metadata.
Returns:
- ~.pagers.ListAgentsPager:
+ google.cloud.dialogflowcx_v3.services.agents.pagers.ListAgentsPager:
The response message for
[Agents.ListAgents][google.cloud.dialogflow.cx.v3.Agents.ListAgents].
@@ -446,12 +512,13 @@ def get_agent(
r"""Retrieves the specified agent.
Args:
- request (:class:`~.agent.GetAgentRequest`):
+ request (google.cloud.dialogflowcx_v3.types.GetAgentRequest):
The request object. The request message for
[Agents.GetAgent][google.cloud.dialogflow.cx.v3.Agents.GetAgent].
- name (:class:`str`):
+ name (str):
Required. The name of the agent. Format:
``projects//locations//agents/``.
+
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -463,20 +530,21 @@ def get_agent(
sent along with the request as metadata.
Returns:
- ~.agent.Agent:
- 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], and
- so on to manage the conversation flows..
+ google.cloud.dialogflowcx_v3.types.Agent:
+ 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],
+ and so on to manage the conversation flows..
"""
# Create or coerce a protobuf request object.
@@ -531,16 +599,17 @@ def create_agent(
r"""Creates an agent in the specified location.
Args:
- request (:class:`~.gcdc_agent.CreateAgentRequest`):
+ request (google.cloud.dialogflowcx_v3.types.CreateAgentRequest):
The request object. The request message for
[Agents.CreateAgent][google.cloud.dialogflow.cx.v3.Agents.CreateAgent].
- parent (:class:`str`):
+ parent (str):
Required. The location to create a agent for. Format:
``projects//locations/``.
+
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
- agent (:class:`~.gcdc_agent.Agent`):
+ agent (google.cloud.dialogflowcx_v3.types.Agent):
Required. The agent to create.
This corresponds to the ``agent`` field
on the ``request`` instance; if ``request`` is provided, this
@@ -553,20 +622,21 @@ def create_agent(
sent along with the request as metadata.
Returns:
- ~.gcdc_agent.Agent:
- 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], and
- so on to manage the conversation flows..
+ google.cloud.dialogflowcx_v3.types.Agent:
+ 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],
+ and so on to manage the conversation flows..
"""
# Create or coerce a protobuf request object.
@@ -623,18 +693,19 @@ def update_agent(
r"""Updates the specified agent.
Args:
- request (:class:`~.gcdc_agent.UpdateAgentRequest`):
+ request (google.cloud.dialogflowcx_v3.types.UpdateAgentRequest):
The request object. The request message for
[Agents.UpdateAgent][google.cloud.dialogflow.cx.v3.Agents.UpdateAgent].
- agent (:class:`~.gcdc_agent.Agent`):
+ agent (google.cloud.dialogflowcx_v3.types.Agent):
Required. The agent to update.
This corresponds to the ``agent`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
- update_mask (:class:`~.field_mask.FieldMask`):
+ update_mask (google.protobuf.field_mask_pb2.FieldMask):
The mask to control which fields get
updated. If the mask is not present, all
fields will be updated.
+
This corresponds to the ``update_mask`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -646,20 +717,21 @@ def update_agent(
sent along with the request as metadata.
Returns:
- ~.gcdc_agent.Agent:
- 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], and
- so on to manage the conversation flows..
+ google.cloud.dialogflowcx_v3.types.Agent:
+ 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],
+ and so on to manage the conversation flows..
"""
# Create or coerce a protobuf request object.
@@ -717,12 +789,13 @@ def delete_agent(
r"""Deletes the specified agent.
Args:
- request (:class:`~.agent.DeleteAgentRequest`):
+ request (google.cloud.dialogflowcx_v3.types.DeleteAgentRequest):
The request object. The request message for
[Agents.DeleteAgent][google.cloud.dialogflow.cx.v3.Agents.DeleteAgent].
- name (:class:`str`):
+ name (str):
Required. The name of the agent to delete. Format:
``projects//locations//agents/``.
+
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -782,7 +855,7 @@ def export_agent(
r"""Exports the specified agent to a binary file.
Args:
- request (:class:`~.agent.ExportAgentRequest`):
+ request (google.cloud.dialogflowcx_v3.types.ExportAgentRequest):
The request object. The request message for
[Agents.ExportAgent][google.cloud.dialogflow.cx.v3.Agents.ExportAgent].
@@ -793,12 +866,12 @@ def export_agent(
sent along with the request as metadata.
Returns:
- ~.operation.Operation:
+ google.api_core.operation.Operation:
An object representing a long-running operation.
The result type for the operation will be
- :class:``~.agent.ExportAgentResponse``: The response
- message for
+ :class:`google.cloud.dialogflowcx_v3.types.ExportAgentResponse`
+ The response message for
[Agents.ExportAgent][google.cloud.dialogflow.cx.v3.Agents.ExportAgent].
"""
@@ -849,7 +922,7 @@ def restore_agent(
flows) will be removed.
Args:
- request (:class:`~.agent.RestoreAgentRequest`):
+ request (google.cloud.dialogflowcx_v3.types.RestoreAgentRequest):
The request object. The request message for
[Agents.RestoreAgent][google.cloud.dialogflow.cx.v3.Agents.RestoreAgent].
@@ -860,24 +933,22 @@ def restore_agent(
sent along with the request as metadata.
Returns:
- ~.operation.Operation:
+ google.api_core.operation.Operation:
An object representing a long-running operation.
- The result type for the operation will be
- :class:``~.empty.Empty``: A generic empty message that
- you can re-use to avoid defining duplicated empty
- messages in your APIs. A typical example is to use it as
- the request or the response type of an API method. For
- instance:
+ The result type for the operation will be :class:`google.protobuf.empty_pb2.Empty` A generic empty message that you can re-use to avoid defining duplicated
+ empty messages in your APIs. A typical example is to
+ use it as the request or the response type of an API
+ method. For instance:
- ::
+ service Foo {
+ rpc Bar(google.protobuf.Empty) returns
+ (google.protobuf.Empty);
- service Foo {
- rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
- }
+ }
- The JSON representation for ``Empty`` is empty JSON
- object ``{}``.
+ The JSON representation for Empty is empty JSON
+ object {}.
"""
# Create or coerce a protobuf request object.
@@ -913,6 +984,138 @@ def restore_agent(
# Done; return the response.
return response
+ def validate_agent(
+ self,
+ request: agent.ValidateAgentRequest = None,
+ *,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> agent.AgentValidationResult:
+ r"""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.
+
+ Args:
+ request (google.cloud.dialogflowcx_v3.types.ValidateAgentRequest):
+ The request object. The request message for
+ [Agents.ValidateAgent][google.cloud.dialogflow.cx.v3.Agents.ValidateAgent].
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ google.cloud.dialogflowcx_v3.types.AgentValidationResult:
+ The response message for
+ [Agents.GetAgentValidationResult][google.cloud.dialogflow.cx.v3.Agents.GetAgentValidationResult].
+
+ """
+ # Create or coerce a protobuf request object.
+
+ # Minor optimization to avoid making a copy if the user passes
+ # in a agent.ValidateAgentRequest.
+ # There's no risk of modifying the input as we've already verified
+ # there are no flattened fields.
+ if not isinstance(request, agent.ValidateAgentRequest):
+ request = agent.ValidateAgentRequest(request)
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = self._transport._wrapped_methods[self._transport.validate_agent]
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ def get_agent_validation_result(
+ self,
+ request: agent.GetAgentValidationResultRequest = None,
+ *,
+ name: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> agent.AgentValidationResult:
+ r"""Gets the latest agent validation result. Agent
+ validation is performed when ValidateAgent is called.
+
+ Args:
+ request (google.cloud.dialogflowcx_v3.types.GetAgentValidationResultRequest):
+ The request object. The request message for
+ [Agents.GetAgentValidationResult][google.cloud.dialogflow.cx.v3.Agents.GetAgentValidationResult].
+ name (str):
+ Required. The agent name. Format:
+ ``projects//locations//agents//validationResult``.
+
+ This corresponds to the ``name`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ google.cloud.dialogflowcx_v3.types.AgentValidationResult:
+ The response message for
+ [Agents.GetAgentValidationResult][google.cloud.dialogflow.cx.v3.Agents.GetAgentValidationResult].
+
+ """
+ # Create or coerce a protobuf request object.
+ # Sanity check: If we got a request object, we should *not* have
+ # gotten any keyword arguments that map to the request.
+ has_flattened_params = any([name])
+ if request is not None and has_flattened_params:
+ raise ValueError(
+ "If the `request` argument is set, then none of "
+ "the individual field arguments should be set."
+ )
+
+ # Minor optimization to avoid making a copy if the user passes
+ # in a agent.GetAgentValidationResultRequest.
+ # There's no risk of modifying the input as we've already verified
+ # there are no flattened fields.
+ if not isinstance(request, agent.GetAgentValidationResultRequest):
+ request = agent.GetAgentValidationResultRequest(request)
+
+ # If we have keyword arguments corresponding to fields on the
+ # request, apply these.
+
+ if name is not None:
+ request.name = name
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = self._transport._wrapped_methods[
+ self._transport.get_agent_validation_result
+ ]
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
try:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/agents/pagers.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/agents/pagers.py
index f5fceec51a30..f937cd8953ac 100644
--- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/agents/pagers.py
+++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/agents/pagers.py
@@ -15,7 +15,16 @@
# limitations under the License.
#
-from typing import Any, AsyncIterable, Awaitable, Callable, Iterable, Sequence, Tuple
+from typing import (
+ Any,
+ AsyncIterable,
+ Awaitable,
+ Callable,
+ Iterable,
+ Sequence,
+ Tuple,
+ Optional,
+)
from google.cloud.dialogflowcx_v3.types import agent
@@ -24,7 +33,7 @@ class ListAgentsPager:
"""A pager for iterating through ``list_agents`` requests.
This class thinly wraps an initial
- :class:`~.agent.ListAgentsResponse` object, and
+ :class:`google.cloud.dialogflowcx_v3.types.ListAgentsResponse` object, and
provides an ``__iter__`` method to iterate through its
``agents`` field.
@@ -33,7 +42,7 @@ class ListAgentsPager:
through the ``agents`` field on the
corresponding responses.
- All the usual :class:`~.agent.ListAgentsResponse`
+ All the usual :class:`google.cloud.dialogflowcx_v3.types.ListAgentsResponse`
attributes are available on the pager. If multiple requests are made, only
the most recent response is retained, and thus used for attribute lookup.
"""
@@ -51,9 +60,9 @@ def __init__(
Args:
method (Callable): The method that was originally called, and
which instantiated this pager.
- request (:class:`~.agent.ListAgentsRequest`):
+ request (google.cloud.dialogflowcx_v3.types.ListAgentsRequest):
The initial request object.
- response (:class:`~.agent.ListAgentsResponse`):
+ response (google.cloud.dialogflowcx_v3.types.ListAgentsResponse):
The initial response object.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
@@ -86,7 +95,7 @@ class ListAgentsAsyncPager:
"""A pager for iterating through ``list_agents`` requests.
This class thinly wraps an initial
- :class:`~.agent.ListAgentsResponse` object, and
+ :class:`google.cloud.dialogflowcx_v3.types.ListAgentsResponse` object, and
provides an ``__aiter__`` method to iterate through its
``agents`` field.
@@ -95,7 +104,7 @@ class ListAgentsAsyncPager:
through the ``agents`` field on the
corresponding responses.
- All the usual :class:`~.agent.ListAgentsResponse`
+ All the usual :class:`google.cloud.dialogflowcx_v3.types.ListAgentsResponse`
attributes are available on the pager. If multiple requests are made, only
the most recent response is retained, and thus used for attribute lookup.
"""
@@ -113,9 +122,9 @@ def __init__(
Args:
method (Callable): The method that was originally called, and
which instantiated this pager.
- request (:class:`~.agent.ListAgentsRequest`):
+ request (google.cloud.dialogflowcx_v3.types.ListAgentsRequest):
The initial request object.
- response (:class:`~.agent.ListAgentsResponse`):
+ response (google.cloud.dialogflowcx_v3.types.ListAgentsResponse):
The initial response object.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/agents/transports/base.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/agents/transports/base.py
index c8f8d07732ac..e313f4deae19 100644
--- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/agents/transports/base.py
+++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/agents/transports/base.py
@@ -134,6 +134,14 @@ def _prep_wrapped_messages(self, client_info):
self.restore_agent: gapic_v1.method.wrap_method(
self.restore_agent, default_timeout=None, client_info=client_info,
),
+ self.validate_agent: gapic_v1.method.wrap_method(
+ self.validate_agent, default_timeout=None, client_info=client_info,
+ ),
+ self.get_agent_validation_result: gapic_v1.method.wrap_method(
+ self.get_agent_validation_result,
+ default_timeout=None,
+ client_info=client_info,
+ ),
}
@property
@@ -206,5 +214,27 @@ def restore_agent(
]:
raise NotImplementedError()
+ @property
+ def validate_agent(
+ self,
+ ) -> typing.Callable[
+ [agent.ValidateAgentRequest],
+ typing.Union[
+ agent.AgentValidationResult, typing.Awaitable[agent.AgentValidationResult]
+ ],
+ ]:
+ raise NotImplementedError()
+
+ @property
+ def get_agent_validation_result(
+ self,
+ ) -> typing.Callable[
+ [agent.GetAgentValidationResultRequest],
+ typing.Union[
+ agent.AgentValidationResult, typing.Awaitable[agent.AgentValidationResult]
+ ],
+ ]:
+ raise NotImplementedError()
+
__all__ = ("AgentsTransport",)
diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/agents/transports/grpc.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/agents/transports/grpc.py
index 496da86b0c26..1522556d9315 100644
--- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/agents/transports/grpc.py
+++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/agents/transports/grpc.py
@@ -61,6 +61,7 @@ def __init__(
api_mtls_endpoint: str = None,
client_cert_source: Callable[[], Tuple[bytes, bytes]] = None,
ssl_channel_credentials: grpc.ChannelCredentials = None,
+ client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None,
quota_project_id: Optional[str] = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
) -> None:
@@ -91,6 +92,10 @@ def __init__(
``api_mtls_endpoint`` is None.
ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials
for grpc channel. It is ignored if ``channel`` is provided.
+ client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]):
+ A callback to provide client certificate bytes and private key bytes,
+ both in PEM format. It is used to configure mutual TLS channel. It is
+ ignored if ``channel`` or ``ssl_channel_credentials`` is provided.
quota_project_id (Optional[str]): An optional project to use for billing
and quota.
client_info (google.api_core.gapic_v1.client_info.ClientInfo):
@@ -107,6 +112,11 @@ def __init__(
"""
self._ssl_channel_credentials = ssl_channel_credentials
+ if api_mtls_endpoint:
+ warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning)
+ if client_cert_source:
+ warnings.warn("client_cert_source is deprecated", DeprecationWarning)
+
if channel:
# Sanity check: Ensure that channel and credentials are not both
# provided.
@@ -116,11 +126,6 @@ def __init__(
self._grpc_channel = channel
self._ssl_channel_credentials = None
elif api_mtls_endpoint:
- warnings.warn(
- "api_mtls_endpoint and client_cert_source are deprecated",
- DeprecationWarning,
- )
-
host = (
api_mtls_endpoint
if ":" in api_mtls_endpoint
@@ -164,12 +169,18 @@ def __init__(
scopes=self.AUTH_SCOPES, quota_project_id=quota_project_id
)
+ if client_cert_source_for_mtls and not ssl_channel_credentials:
+ cert, key = client_cert_source_for_mtls()
+ self._ssl_channel_credentials = grpc.ssl_channel_credentials(
+ certificate_chain=cert, private_key=key
+ )
+
# create a new channel. The provided one is ignored.
self._grpc_channel = type(self).create_channel(
host,
credentials=credentials,
credentials_file=credentials_file,
- ssl_credentials=ssl_channel_credentials,
+ ssl_credentials=self._ssl_channel_credentials,
scopes=scopes or self.AUTH_SCOPES,
quota_project_id=quota_project_id,
options=[
@@ -438,5 +449,61 @@ def restore_agent(
)
return self._stubs["restore_agent"]
+ @property
+ def validate_agent(
+ self,
+ ) -> Callable[[agent.ValidateAgentRequest], agent.AgentValidationResult]:
+ r"""Return a callable for the validate agent method over gRPC.
+
+ 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.
+
+ Returns:
+ Callable[[~.ValidateAgentRequest],
+ ~.AgentValidationResult]:
+ A function that, when called, will call the underlying RPC
+ on the server.
+ """
+ # Generate a "stub function" on-the-fly which will actually make
+ # the request.
+ # gRPC handles serialization and deserialization, so we just need
+ # to pass in the functions for each.
+ if "validate_agent" not in self._stubs:
+ self._stubs["validate_agent"] = self.grpc_channel.unary_unary(
+ "/google.cloud.dialogflow.cx.v3.Agents/ValidateAgent",
+ request_serializer=agent.ValidateAgentRequest.serialize,
+ response_deserializer=agent.AgentValidationResult.deserialize,
+ )
+ return self._stubs["validate_agent"]
+
+ @property
+ def get_agent_validation_result(
+ self,
+ ) -> Callable[[agent.GetAgentValidationResultRequest], agent.AgentValidationResult]:
+ r"""Return a callable for the get agent validation result method over gRPC.
+
+ Gets the latest agent validation result. Agent
+ validation is performed when ValidateAgent is called.
+
+ Returns:
+ Callable[[~.GetAgentValidationResultRequest],
+ ~.AgentValidationResult]:
+ A function that, when called, will call the underlying RPC
+ on the server.
+ """
+ # Generate a "stub function" on-the-fly which will actually make
+ # the request.
+ # gRPC handles serialization and deserialization, so we just need
+ # to pass in the functions for each.
+ if "get_agent_validation_result" not in self._stubs:
+ self._stubs["get_agent_validation_result"] = self.grpc_channel.unary_unary(
+ "/google.cloud.dialogflow.cx.v3.Agents/GetAgentValidationResult",
+ request_serializer=agent.GetAgentValidationResultRequest.serialize,
+ response_deserializer=agent.AgentValidationResult.deserialize,
+ )
+ return self._stubs["get_agent_validation_result"]
+
__all__ = ("AgentsGrpcTransport",)
diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/agents/transports/grpc_asyncio.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/agents/transports/grpc_asyncio.py
index fb4eb8fbea0c..30d00bd90436 100644
--- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/agents/transports/grpc_asyncio.py
+++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/agents/transports/grpc_asyncio.py
@@ -105,6 +105,7 @@ def __init__(
api_mtls_endpoint: str = None,
client_cert_source: Callable[[], Tuple[bytes, bytes]] = None,
ssl_channel_credentials: grpc.ChannelCredentials = None,
+ client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None,
quota_project_id=None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
) -> None:
@@ -136,6 +137,10 @@ def __init__(
``api_mtls_endpoint`` is None.
ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials
for grpc channel. It is ignored if ``channel`` is provided.
+ client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]):
+ A callback to provide client certificate bytes and private key bytes,
+ both in PEM format. It is used to configure mutual TLS channel. It is
+ ignored if ``channel`` or ``ssl_channel_credentials`` is provided.
quota_project_id (Optional[str]): An optional project to use for billing
and quota.
client_info (google.api_core.gapic_v1.client_info.ClientInfo):
@@ -152,6 +157,11 @@ def __init__(
"""
self._ssl_channel_credentials = ssl_channel_credentials
+ if api_mtls_endpoint:
+ warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning)
+ if client_cert_source:
+ warnings.warn("client_cert_source is deprecated", DeprecationWarning)
+
if channel:
# Sanity check: Ensure that channel and credentials are not both
# provided.
@@ -161,11 +171,6 @@ def __init__(
self._grpc_channel = channel
self._ssl_channel_credentials = None
elif api_mtls_endpoint:
- warnings.warn(
- "api_mtls_endpoint and client_cert_source are deprecated",
- DeprecationWarning,
- )
-
host = (
api_mtls_endpoint
if ":" in api_mtls_endpoint
@@ -209,12 +214,18 @@ def __init__(
scopes=self.AUTH_SCOPES, quota_project_id=quota_project_id
)
+ if client_cert_source_for_mtls and not ssl_channel_credentials:
+ cert, key = client_cert_source_for_mtls()
+ self._ssl_channel_credentials = grpc.ssl_channel_credentials(
+ certificate_chain=cert, private_key=key
+ )
+
# create a new channel. The provided one is ignored.
self._grpc_channel = type(self).create_channel(
host,
credentials=credentials,
credentials_file=credentials_file,
- ssl_credentials=ssl_channel_credentials,
+ ssl_credentials=self._ssl_channel_credentials,
scopes=scopes or self.AUTH_SCOPES,
quota_project_id=quota_project_id,
options=[
@@ -446,5 +457,63 @@ def restore_agent(
)
return self._stubs["restore_agent"]
+ @property
+ def validate_agent(
+ self,
+ ) -> Callable[[agent.ValidateAgentRequest], Awaitable[agent.AgentValidationResult]]:
+ r"""Return a callable for the validate agent method over gRPC.
+
+ 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.
+
+ Returns:
+ Callable[[~.ValidateAgentRequest],
+ Awaitable[~.AgentValidationResult]]:
+ A function that, when called, will call the underlying RPC
+ on the server.
+ """
+ # Generate a "stub function" on-the-fly which will actually make
+ # the request.
+ # gRPC handles serialization and deserialization, so we just need
+ # to pass in the functions for each.
+ if "validate_agent" not in self._stubs:
+ self._stubs["validate_agent"] = self.grpc_channel.unary_unary(
+ "/google.cloud.dialogflow.cx.v3.Agents/ValidateAgent",
+ request_serializer=agent.ValidateAgentRequest.serialize,
+ response_deserializer=agent.AgentValidationResult.deserialize,
+ )
+ return self._stubs["validate_agent"]
+
+ @property
+ def get_agent_validation_result(
+ self,
+ ) -> Callable[
+ [agent.GetAgentValidationResultRequest], Awaitable[agent.AgentValidationResult]
+ ]:
+ r"""Return a callable for the get agent validation result method over gRPC.
+
+ Gets the latest agent validation result. Agent
+ validation is performed when ValidateAgent is called.
+
+ Returns:
+ Callable[[~.GetAgentValidationResultRequest],
+ Awaitable[~.AgentValidationResult]]:
+ A function that, when called, will call the underlying RPC
+ on the server.
+ """
+ # Generate a "stub function" on-the-fly which will actually make
+ # the request.
+ # gRPC handles serialization and deserialization, so we just need
+ # to pass in the functions for each.
+ if "get_agent_validation_result" not in self._stubs:
+ self._stubs["get_agent_validation_result"] = self.grpc_channel.unary_unary(
+ "/google.cloud.dialogflow.cx.v3.Agents/GetAgentValidationResult",
+ request_serializer=agent.GetAgentValidationResultRequest.serialize,
+ response_deserializer=agent.AgentValidationResult.deserialize,
+ )
+ return self._stubs["get_agent_validation_result"]
+
__all__ = ("AgentsGrpcAsyncIOTransport",)
diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/entity_types/async_client.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/entity_types/async_client.py
index 3397af5ba562..f74b07c02c34 100644
--- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/entity_types/async_client.py
+++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/entity_types/async_client.py
@@ -76,7 +76,36 @@ class EntityTypesAsyncClient:
EntityTypesClient.parse_common_location_path
)
- from_service_account_file = EntityTypesClient.from_service_account_file
+ @classmethod
+ def from_service_account_info(cls, info: dict, *args, **kwargs):
+ """Creates an instance of this client using the provided credentials info.
+
+ Args:
+ info (dict): The service account private key info.
+ args: Additional arguments to pass to the constructor.
+ kwargs: Additional arguments to pass to the constructor.
+
+ Returns:
+ EntityTypesAsyncClient: The constructed client.
+ """
+ return EntityTypesClient.from_service_account_info.__func__(EntityTypesAsyncClient, info, *args, **kwargs) # type: ignore
+
+ @classmethod
+ def from_service_account_file(cls, filename: str, *args, **kwargs):
+ """Creates an instance of this client using the provided credentials
+ file.
+
+ Args:
+ filename (str): The path to the service account private key json
+ file.
+ args: Additional arguments to pass to the constructor.
+ kwargs: Additional arguments to pass to the constructor.
+
+ Returns:
+ EntityTypesAsyncClient: The constructed client.
+ """
+ return EntityTypesClient.from_service_account_file.__func__(EntityTypesAsyncClient, filename, *args, **kwargs) # type: ignore
+
from_service_account_json = from_service_account_file
@property
@@ -153,13 +182,14 @@ async def list_entity_types(
agent.
Args:
- request (:class:`~.entity_type.ListEntityTypesRequest`):
+ request (:class:`google.cloud.dialogflowcx_v3.types.ListEntityTypesRequest`):
The request object. The request message for
[EntityTypes.ListEntityTypes][google.cloud.dialogflow.cx.v3.EntityTypes.ListEntityTypes].
parent (:class:`str`):
Required. The agent to list all entity types for.
Format:
``projects//locations//agents/``.
+
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -171,7 +201,7 @@ async def list_entity_types(
sent along with the request as metadata.
Returns:
- ~.pagers.ListEntityTypesAsyncPager:
+ google.cloud.dialogflowcx_v3.services.entity_types.pagers.ListEntityTypesAsyncPager:
The response message for
[EntityTypes.ListEntityTypes][google.cloud.dialogflow.cx.v3.EntityTypes.ListEntityTypes].
@@ -235,12 +265,13 @@ async def get_entity_type(
r"""Retrieves the specified entity type.
Args:
- request (:class:`~.entity_type.GetEntityTypeRequest`):
+ request (:class:`google.cloud.dialogflowcx_v3.types.GetEntityTypeRequest`):
The request object. The request message for
[EntityTypes.GetEntityType][google.cloud.dialogflow.cx.v3.EntityTypes.GetEntityType].
name (:class:`str`):
Required. The name of the entity type. Format:
``projects//locations//agents//entityTypes/``.
+
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -252,42 +283,41 @@ async def get_entity_type(
sent along with the request as metadata.
Returns:
- ~.entity_type.EntityType:
- 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 `__.
+ google.cloud.dialogflowcx_v3.types.EntityType:
+ 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).
"""
# Create or coerce a protobuf request object.
@@ -341,16 +371,17 @@ async def create_entity_type(
r"""Creates an entity type in the specified agent.
Args:
- request (:class:`~.gcdc_entity_type.CreateEntityTypeRequest`):
+ request (:class:`google.cloud.dialogflowcx_v3.types.CreateEntityTypeRequest`):
The request object. The request message for
[EntityTypes.CreateEntityType][google.cloud.dialogflow.cx.v3.EntityTypes.CreateEntityType].
parent (:class:`str`):
Required. The agent to create a entity type for. Format:
``projects//locations//agents/``.
+
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
- entity_type (:class:`~.gcdc_entity_type.EntityType`):
+ entity_type (:class:`google.cloud.dialogflowcx_v3.types.EntityType`):
Required. The entity type to create.
This corresponds to the ``entity_type`` field
on the ``request`` instance; if ``request`` is provided, this
@@ -363,42 +394,41 @@ async def create_entity_type(
sent along with the request as metadata.
Returns:
- ~.gcdc_entity_type.EntityType:
- 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 `__.
+ google.cloud.dialogflowcx_v3.types.EntityType:
+ 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).
"""
# Create or coerce a protobuf request object.
@@ -454,17 +484,18 @@ async def update_entity_type(
r"""Updates the specified entity type.
Args:
- request (:class:`~.gcdc_entity_type.UpdateEntityTypeRequest`):
+ request (:class:`google.cloud.dialogflowcx_v3.types.UpdateEntityTypeRequest`):
The request object. The request message for
[EntityTypes.UpdateEntityType][google.cloud.dialogflow.cx.v3.EntityTypes.UpdateEntityType].
- entity_type (:class:`~.gcdc_entity_type.EntityType`):
+ entity_type (:class:`google.cloud.dialogflowcx_v3.types.EntityType`):
Required. The entity type to update.
This corresponds to the ``entity_type`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
- update_mask (:class:`~.field_mask.FieldMask`):
+ update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`):
The mask to control which fields get
updated.
+
This corresponds to the ``update_mask`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -476,42 +507,41 @@ async def update_entity_type(
sent along with the request as metadata.
Returns:
- ~.gcdc_entity_type.EntityType:
- 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 `__.
+ google.cloud.dialogflowcx_v3.types.EntityType:
+ 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).
"""
# Create or coerce a protobuf request object.
@@ -568,12 +598,13 @@ async def delete_entity_type(
r"""Deletes the specified entity type.
Args:
- request (:class:`~.entity_type.DeleteEntityTypeRequest`):
+ request (:class:`google.cloud.dialogflowcx_v3.types.DeleteEntityTypeRequest`):
The request object. The request message for
[EntityTypes.DeleteEntityType][google.cloud.dialogflow.cx.v3.EntityTypes.DeleteEntityType].
name (:class:`str`):
Required. The name of the entity type to delete. Format:
``projects//locations//agents//entityTypes/``.
+
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/entity_types/client.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/entity_types/client.py
index aacf1f5ef61b..852b3ef41ae2 100644
--- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/entity_types/client.py
+++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/entity_types/client.py
@@ -112,6 +112,22 @@ def _get_default_mtls_endpoint(api_endpoint):
DEFAULT_ENDPOINT
)
+ @classmethod
+ def from_service_account_info(cls, info: dict, *args, **kwargs):
+ """Creates an instance of this client using the provided credentials info.
+
+ Args:
+ info (dict): The service account private key info.
+ args: Additional arguments to pass to the constructor.
+ kwargs: Additional arguments to pass to the constructor.
+
+ Returns:
+ EntityTypesClient: The constructed client.
+ """
+ credentials = service_account.Credentials.from_service_account_info(info)
+ kwargs["credentials"] = credentials
+ return cls(*args, **kwargs)
+
@classmethod
def from_service_account_file(cls, filename: str, *args, **kwargs):
"""Creates an instance of this client using the provided credentials
@@ -124,7 +140,7 @@ def from_service_account_file(cls, filename: str, *args, **kwargs):
kwargs: Additional arguments to pass to the constructor.
Returns:
- {@api.name}: The constructed client.
+ EntityTypesClient: The constructed client.
"""
credentials = service_account.Credentials.from_service_account_file(filename)
kwargs["credentials"] = credentials
@@ -234,10 +250,10 @@ def __init__(
credentials identify the application to the service; if none
are specified, the client will attempt to ascertain the
credentials from the environment.
- transport (Union[str, ~.EntityTypesTransport]): The
+ transport (Union[str, EntityTypesTransport]): The
transport to use. If set to None, a transport is chosen
automatically.
- client_options (client_options_lib.ClientOptions): Custom options for the
+ client_options (google.api_core.client_options.ClientOptions): Custom options for the
client. It won't take effect if a ``transport`` instance is provided.
(1) The ``api_endpoint`` property can be used to override the
default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT
@@ -273,21 +289,17 @@ def __init__(
util.strtobool(os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false"))
)
- ssl_credentials = None
+ client_cert_source_func = None
is_mtls = False
if use_client_cert:
if client_options.client_cert_source:
- import grpc # type: ignore
-
- cert, key = client_options.client_cert_source()
- ssl_credentials = grpc.ssl_channel_credentials(
- certificate_chain=cert, private_key=key
- )
is_mtls = True
+ client_cert_source_func = client_options.client_cert_source
else:
- creds = SslCredentials()
- is_mtls = creds.is_mtls
- ssl_credentials = creds.ssl_credentials if is_mtls else None
+ is_mtls = mtls.has_default_client_cert_source()
+ client_cert_source_func = (
+ mtls.default_client_cert_source() if is_mtls else None
+ )
# Figure out which api endpoint to use.
if client_options.api_endpoint is not None:
@@ -330,7 +342,7 @@ def __init__(
credentials_file=client_options.credentials_file,
host=api_endpoint,
scopes=client_options.scopes,
- ssl_channel_credentials=ssl_credentials,
+ client_cert_source_for_mtls=client_cert_source_func,
quota_project_id=client_options.quota_project_id,
client_info=client_info,
)
@@ -348,13 +360,14 @@ def list_entity_types(
agent.
Args:
- request (:class:`~.entity_type.ListEntityTypesRequest`):
+ request (google.cloud.dialogflowcx_v3.types.ListEntityTypesRequest):
The request object. The request message for
[EntityTypes.ListEntityTypes][google.cloud.dialogflow.cx.v3.EntityTypes.ListEntityTypes].
- parent (:class:`str`):
+ parent (str):
Required. The agent to list all entity types for.
Format:
``projects//locations//agents/``.
+
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -366,7 +379,7 @@ def list_entity_types(
sent along with the request as metadata.
Returns:
- ~.pagers.ListEntityTypesPager:
+ google.cloud.dialogflowcx_v3.services.entity_types.pagers.ListEntityTypesPager:
The response message for
[EntityTypes.ListEntityTypes][google.cloud.dialogflow.cx.v3.EntityTypes.ListEntityTypes].
@@ -431,12 +444,13 @@ def get_entity_type(
r"""Retrieves the specified entity type.
Args:
- request (:class:`~.entity_type.GetEntityTypeRequest`):
+ request (google.cloud.dialogflowcx_v3.types.GetEntityTypeRequest):
The request object. The request message for
[EntityTypes.GetEntityType][google.cloud.dialogflow.cx.v3.EntityTypes.GetEntityType].
- name (:class:`str`):
+ name (str):
Required. The name of the entity type. Format:
``projects//locations//agents//entityTypes/``.
+
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -448,42 +462,41 @@ def get_entity_type(
sent along with the request as metadata.
Returns:
- ~.entity_type.EntityType:
- 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 `__.
+ google.cloud.dialogflowcx_v3.types.EntityType:
+ 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).
"""
# Create or coerce a protobuf request object.
@@ -538,16 +551,17 @@ def create_entity_type(
r"""Creates an entity type in the specified agent.
Args:
- request (:class:`~.gcdc_entity_type.CreateEntityTypeRequest`):
+ request (google.cloud.dialogflowcx_v3.types.CreateEntityTypeRequest):
The request object. The request message for
[EntityTypes.CreateEntityType][google.cloud.dialogflow.cx.v3.EntityTypes.CreateEntityType].
- parent (:class:`str`):
+ parent (str):
Required. The agent to create a entity type for. Format:
``projects//locations//agents/``.
+
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
- entity_type (:class:`~.gcdc_entity_type.EntityType`):
+ entity_type (google.cloud.dialogflowcx_v3.types.EntityType):
Required. The entity type to create.
This corresponds to the ``entity_type`` field
on the ``request`` instance; if ``request`` is provided, this
@@ -560,42 +574,41 @@ def create_entity_type(
sent along with the request as metadata.
Returns:
- ~.gcdc_entity_type.EntityType:
- 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 `__.
+ google.cloud.dialogflowcx_v3.types.EntityType:
+ 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).
"""
# Create or coerce a protobuf request object.
@@ -652,17 +665,18 @@ def update_entity_type(
r"""Updates the specified entity type.
Args:
- request (:class:`~.gcdc_entity_type.UpdateEntityTypeRequest`):
+ request (google.cloud.dialogflowcx_v3.types.UpdateEntityTypeRequest):
The request object. The request message for
[EntityTypes.UpdateEntityType][google.cloud.dialogflow.cx.v3.EntityTypes.UpdateEntityType].
- entity_type (:class:`~.gcdc_entity_type.EntityType`):
+ entity_type (google.cloud.dialogflowcx_v3.types.EntityType):
Required. The entity type to update.
This corresponds to the ``entity_type`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
- update_mask (:class:`~.field_mask.FieldMask`):
+ update_mask (google.protobuf.field_mask_pb2.FieldMask):
The mask to control which fields get
updated.
+
This corresponds to the ``update_mask`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -674,42 +688,41 @@ def update_entity_type(
sent along with the request as metadata.
Returns:
- ~.gcdc_entity_type.EntityType:
- 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 `__.
+ google.cloud.dialogflowcx_v3.types.EntityType:
+ 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).
"""
# Create or coerce a protobuf request object.
@@ -767,12 +780,13 @@ def delete_entity_type(
r"""Deletes the specified entity type.
Args:
- request (:class:`~.entity_type.DeleteEntityTypeRequest`):
+ request (google.cloud.dialogflowcx_v3.types.DeleteEntityTypeRequest):
The request object. The request message for
[EntityTypes.DeleteEntityType][google.cloud.dialogflow.cx.v3.EntityTypes.DeleteEntityType].
- name (:class:`str`):
+ name (str):
Required. The name of the entity type to delete. Format:
``projects//locations//agents//entityTypes/``.
+
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/entity_types/pagers.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/entity_types/pagers.py
index edafb73d6dc4..5a57595394a3 100644
--- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/entity_types/pagers.py
+++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/entity_types/pagers.py
@@ -15,7 +15,16 @@
# limitations under the License.
#
-from typing import Any, AsyncIterable, Awaitable, Callable, Iterable, Sequence, Tuple
+from typing import (
+ Any,
+ AsyncIterable,
+ Awaitable,
+ Callable,
+ Iterable,
+ Sequence,
+ Tuple,
+ Optional,
+)
from google.cloud.dialogflowcx_v3.types import entity_type
@@ -24,7 +33,7 @@ class ListEntityTypesPager:
"""A pager for iterating through ``list_entity_types`` requests.
This class thinly wraps an initial
- :class:`~.entity_type.ListEntityTypesResponse` object, and
+ :class:`google.cloud.dialogflowcx_v3.types.ListEntityTypesResponse` object, and
provides an ``__iter__`` method to iterate through its
``entity_types`` field.
@@ -33,7 +42,7 @@ class ListEntityTypesPager:
through the ``entity_types`` field on the
corresponding responses.
- All the usual :class:`~.entity_type.ListEntityTypesResponse`
+ All the usual :class:`google.cloud.dialogflowcx_v3.types.ListEntityTypesResponse`
attributes are available on the pager. If multiple requests are made, only
the most recent response is retained, and thus used for attribute lookup.
"""
@@ -51,9 +60,9 @@ def __init__(
Args:
method (Callable): The method that was originally called, and
which instantiated this pager.
- request (:class:`~.entity_type.ListEntityTypesRequest`):
+ request (google.cloud.dialogflowcx_v3.types.ListEntityTypesRequest):
The initial request object.
- response (:class:`~.entity_type.ListEntityTypesResponse`):
+ response (google.cloud.dialogflowcx_v3.types.ListEntityTypesResponse):
The initial response object.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
@@ -86,7 +95,7 @@ class ListEntityTypesAsyncPager:
"""A pager for iterating through ``list_entity_types`` requests.
This class thinly wraps an initial
- :class:`~.entity_type.ListEntityTypesResponse` object, and
+ :class:`google.cloud.dialogflowcx_v3.types.ListEntityTypesResponse` object, and
provides an ``__aiter__`` method to iterate through its
``entity_types`` field.
@@ -95,7 +104,7 @@ class ListEntityTypesAsyncPager:
through the ``entity_types`` field on the
corresponding responses.
- All the usual :class:`~.entity_type.ListEntityTypesResponse`
+ All the usual :class:`google.cloud.dialogflowcx_v3.types.ListEntityTypesResponse`
attributes are available on the pager. If multiple requests are made, only
the most recent response is retained, and thus used for attribute lookup.
"""
@@ -113,9 +122,9 @@ def __init__(
Args:
method (Callable): The method that was originally called, and
which instantiated this pager.
- request (:class:`~.entity_type.ListEntityTypesRequest`):
+ request (google.cloud.dialogflowcx_v3.types.ListEntityTypesRequest):
The initial request object.
- response (:class:`~.entity_type.ListEntityTypesResponse`):
+ response (google.cloud.dialogflowcx_v3.types.ListEntityTypesResponse):
The initial response object.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/entity_types/transports/grpc.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/entity_types/transports/grpc.py
index e4f92f71ae3c..24b05efeb2b7 100644
--- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/entity_types/transports/grpc.py
+++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/entity_types/transports/grpc.py
@@ -60,6 +60,7 @@ def __init__(
api_mtls_endpoint: str = None,
client_cert_source: Callable[[], Tuple[bytes, bytes]] = None,
ssl_channel_credentials: grpc.ChannelCredentials = None,
+ client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None,
quota_project_id: Optional[str] = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
) -> None:
@@ -90,6 +91,10 @@ def __init__(
``api_mtls_endpoint`` is None.
ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials
for grpc channel. It is ignored if ``channel`` is provided.
+ client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]):
+ A callback to provide client certificate bytes and private key bytes,
+ both in PEM format. It is used to configure mutual TLS channel. It is
+ ignored if ``channel`` or ``ssl_channel_credentials`` is provided.
quota_project_id (Optional[str]): An optional project to use for billing
and quota.
client_info (google.api_core.gapic_v1.client_info.ClientInfo):
@@ -106,6 +111,11 @@ def __init__(
"""
self._ssl_channel_credentials = ssl_channel_credentials
+ if api_mtls_endpoint:
+ warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning)
+ if client_cert_source:
+ warnings.warn("client_cert_source is deprecated", DeprecationWarning)
+
if channel:
# Sanity check: Ensure that channel and credentials are not both
# provided.
@@ -115,11 +125,6 @@ def __init__(
self._grpc_channel = channel
self._ssl_channel_credentials = None
elif api_mtls_endpoint:
- warnings.warn(
- "api_mtls_endpoint and client_cert_source are deprecated",
- DeprecationWarning,
- )
-
host = (
api_mtls_endpoint
if ":" in api_mtls_endpoint
@@ -163,12 +168,18 @@ def __init__(
scopes=self.AUTH_SCOPES, quota_project_id=quota_project_id
)
+ if client_cert_source_for_mtls and not ssl_channel_credentials:
+ cert, key = client_cert_source_for_mtls()
+ self._ssl_channel_credentials = grpc.ssl_channel_credentials(
+ certificate_chain=cert, private_key=key
+ )
+
# create a new channel. The provided one is ignored.
self._grpc_channel = type(self).create_channel(
host,
credentials=credentials,
credentials_file=credentials_file,
- ssl_credentials=ssl_channel_credentials,
+ ssl_credentials=self._ssl_channel_credentials,
scopes=scopes or self.AUTH_SCOPES,
quota_project_id=quota_project_id,
options=[
diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/entity_types/transports/grpc_asyncio.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/entity_types/transports/grpc_asyncio.py
index a3c095634384..210f2c7f7aa7 100644
--- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/entity_types/transports/grpc_asyncio.py
+++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/entity_types/transports/grpc_asyncio.py
@@ -104,6 +104,7 @@ def __init__(
api_mtls_endpoint: str = None,
client_cert_source: Callable[[], Tuple[bytes, bytes]] = None,
ssl_channel_credentials: grpc.ChannelCredentials = None,
+ client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None,
quota_project_id=None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
) -> None:
@@ -135,6 +136,10 @@ def __init__(
``api_mtls_endpoint`` is None.
ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials
for grpc channel. It is ignored if ``channel`` is provided.
+ client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]):
+ A callback to provide client certificate bytes and private key bytes,
+ both in PEM format. It is used to configure mutual TLS channel. It is
+ ignored if ``channel`` or ``ssl_channel_credentials`` is provided.
quota_project_id (Optional[str]): An optional project to use for billing
and quota.
client_info (google.api_core.gapic_v1.client_info.ClientInfo):
@@ -151,6 +156,11 @@ def __init__(
"""
self._ssl_channel_credentials = ssl_channel_credentials
+ if api_mtls_endpoint:
+ warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning)
+ if client_cert_source:
+ warnings.warn("client_cert_source is deprecated", DeprecationWarning)
+
if channel:
# Sanity check: Ensure that channel and credentials are not both
# provided.
@@ -160,11 +170,6 @@ def __init__(
self._grpc_channel = channel
self._ssl_channel_credentials = None
elif api_mtls_endpoint:
- warnings.warn(
- "api_mtls_endpoint and client_cert_source are deprecated",
- DeprecationWarning,
- )
-
host = (
api_mtls_endpoint
if ":" in api_mtls_endpoint
@@ -208,12 +213,18 @@ def __init__(
scopes=self.AUTH_SCOPES, quota_project_id=quota_project_id
)
+ if client_cert_source_for_mtls and not ssl_channel_credentials:
+ cert, key = client_cert_source_for_mtls()
+ self._ssl_channel_credentials = grpc.ssl_channel_credentials(
+ certificate_chain=cert, private_key=key
+ )
+
# create a new channel. The provided one is ignored.
self._grpc_channel = type(self).create_channel(
host,
credentials=credentials,
credentials_file=credentials_file,
- ssl_credentials=ssl_channel_credentials,
+ ssl_credentials=self._ssl_channel_credentials,
scopes=scopes or self.AUTH_SCOPES,
quota_project_id=quota_project_id,
options=[
diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/environments/async_client.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/environments/async_client.py
index edf94a12c506..542ce93b8270 100644
--- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/environments/async_client.py
+++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/environments/async_client.py
@@ -82,7 +82,36 @@ class EnvironmentsAsyncClient:
EnvironmentsClient.parse_common_location_path
)
- from_service_account_file = EnvironmentsClient.from_service_account_file
+ @classmethod
+ def from_service_account_info(cls, info: dict, *args, **kwargs):
+ """Creates an instance of this client using the provided credentials info.
+
+ Args:
+ info (dict): The service account private key info.
+ args: Additional arguments to pass to the constructor.
+ kwargs: Additional arguments to pass to the constructor.
+
+ Returns:
+ EnvironmentsAsyncClient: The constructed client.
+ """
+ return EnvironmentsClient.from_service_account_info.__func__(EnvironmentsAsyncClient, info, *args, **kwargs) # type: ignore
+
+ @classmethod
+ def from_service_account_file(cls, filename: str, *args, **kwargs):
+ """Creates an instance of this client using the provided credentials
+ file.
+
+ Args:
+ filename (str): The path to the service account private key json
+ file.
+ args: Additional arguments to pass to the constructor.
+ kwargs: Additional arguments to pass to the constructor.
+
+ Returns:
+ EnvironmentsAsyncClient: The constructed client.
+ """
+ return EnvironmentsClient.from_service_account_file.__func__(EnvironmentsAsyncClient, filename, *args, **kwargs) # type: ignore
+
from_service_account_json = from_service_account_file
@property
@@ -159,7 +188,7 @@ async def list_environments(
[Agent][google.cloud.dialogflow.cx.v3.Agent].
Args:
- request (:class:`~.environment.ListEnvironmentsRequest`):
+ request (:class:`google.cloud.dialogflowcx_v3.types.ListEnvironmentsRequest`):
The request object. The request message for
[Environments.ListEnvironments][google.cloud.dialogflow.cx.v3.Environments.ListEnvironments].
parent (:class:`str`):
@@ -167,6 +196,7 @@ async def list_environments(
[Agent][google.cloud.dialogflow.cx.v3.Agent] to list all
environments for. Format:
``projects//locations//agents/``.
+
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -178,7 +208,7 @@ async def list_environments(
sent along with the request as metadata.
Returns:
- ~.pagers.ListEnvironmentsAsyncPager:
+ google.cloud.dialogflowcx_v3.services.environments.pagers.ListEnvironmentsAsyncPager:
The response message for
[Environments.ListEnvironments][google.cloud.dialogflow.cx.v3.Environments.ListEnvironments].
@@ -243,7 +273,7 @@ async def get_environment(
[Environment][google.cloud.dialogflow.cx.v3.Environment].
Args:
- request (:class:`~.environment.GetEnvironmentRequest`):
+ request (:class:`google.cloud.dialogflowcx_v3.types.GetEnvironmentRequest`):
The request object. The request message for
[Environments.GetEnvironment][google.cloud.dialogflow.cx.v3.Environments.GetEnvironment].
name (:class:`str`):
@@ -251,6 +281,7 @@ async def get_environment(
[Environment][google.cloud.dialogflow.cx.v3.Environment].
Format:
``projects//locations//agents//environments/``.
+
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -262,7 +293,7 @@ async def get_environment(
sent along with the request as metadata.
Returns:
- ~.environment.Environment:
+ google.cloud.dialogflowcx_v3.types.Environment:
Represents an environment for an
agent. You can create multiple versions
of your agent and publish them to
@@ -333,7 +364,7 @@ async def create_environment(
specified [Agent][google.cloud.dialogflow.cx.v3.Agent].
Args:
- request (:class:`~.gcdc_environment.CreateEnvironmentRequest`):
+ request (:class:`google.cloud.dialogflowcx_v3.types.CreateEnvironmentRequest`):
The request object. The request message for
[Environments.CreateEnvironment][google.cloud.dialogflow.cx.v3.Environments.CreateEnvironment].
parent (:class:`str`):
@@ -343,10 +374,11 @@ async def create_environment(
[Environment][google.cloud.dialogflow.cx.v3.Environment]
for. Format:
``projects//locations//agents/``.
+
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
- environment (:class:`~.gcdc_environment.Environment`):
+ environment (:class:`google.cloud.dialogflowcx_v3.types.Environment`):
Required. The environment to create.
This corresponds to the ``environment`` field
on the ``request`` instance; if ``request`` is provided, this
@@ -359,21 +391,20 @@ async def create_environment(
sent along with the request as metadata.
Returns:
- ~.operation_async.AsyncOperation:
+ google.api_core.operation_async.AsyncOperation:
An object representing a long-running operation.
- The result type for the operation will be
- :class:``~.gcdc_environment.Environment``: 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.
+ The result type for the operation will be :class:`google.cloud.dialogflowcx_v3.types.Environment` 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.
"""
# Create or coerce a protobuf request object.
@@ -438,17 +469,18 @@ async def update_environment(
[Environment][google.cloud.dialogflow.cx.v3.Environment].
Args:
- request (:class:`~.gcdc_environment.UpdateEnvironmentRequest`):
+ request (:class:`google.cloud.dialogflowcx_v3.types.UpdateEnvironmentRequest`):
The request object. The request message for
[Environments.UpdateEnvironment][google.cloud.dialogflow.cx.v3.Environments.UpdateEnvironment].
- environment (:class:`~.gcdc_environment.Environment`):
+ environment (:class:`google.cloud.dialogflowcx_v3.types.Environment`):
Required. The environment to update.
This corresponds to the ``environment`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
- update_mask (:class:`~.field_mask.FieldMask`):
+ update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`):
Required. The mask to control which
fields get updated.
+
This corresponds to the ``update_mask`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -460,21 +492,20 @@ async def update_environment(
sent along with the request as metadata.
Returns:
- ~.operation_async.AsyncOperation:
+ google.api_core.operation_async.AsyncOperation:
An object representing a long-running operation.
- The result type for the operation will be
- :class:``~.gcdc_environment.Environment``: 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.
+ The result type for the operation will be :class:`google.cloud.dialogflowcx_v3.types.Environment` 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.
"""
# Create or coerce a protobuf request object.
@@ -540,7 +571,7 @@ async def delete_environment(
[Environment][google.cloud.dialogflow.cx.v3.Environment].
Args:
- request (:class:`~.environment.DeleteEnvironmentRequest`):
+ request (:class:`google.cloud.dialogflowcx_v3.types.DeleteEnvironmentRequest`):
The request object. The request message for
[Environments.DeleteEnvironment][google.cloud.dialogflow.cx.v3.Environments.DeleteEnvironment].
name (:class:`str`):
@@ -548,6 +579,7 @@ async def delete_environment(
[Environment][google.cloud.dialogflow.cx.v3.Environment]
to delete. Format:
``projects//locations//agents//environments/``.
+
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -608,13 +640,14 @@ async def lookup_environment_history(
[Environment][google.cloud.dialogflow.cx.v3.Environment].
Args:
- request (:class:`~.environment.LookupEnvironmentHistoryRequest`):
+ request (:class:`google.cloud.dialogflowcx_v3.types.LookupEnvironmentHistoryRequest`):
The request object. The request message for
[Environments.LookupEnvironmentHistory][google.cloud.dialogflow.cx.v3.Environments.LookupEnvironmentHistory].
name (:class:`str`):
Required. Resource name of the environment to look up
the history for. Format:
``projects//locations//agents//environments/``.
+
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -626,7 +659,7 @@ async def lookup_environment_history(
sent along with the request as metadata.
Returns:
- ~.pagers.LookupEnvironmentHistoryAsyncPager:
+ google.cloud.dialogflowcx_v3.services.environments.pagers.LookupEnvironmentHistoryAsyncPager:
The response message for
[Environments.LookupEnvironmentHistory][google.cloud.dialogflow.cx.v3.Environments.LookupEnvironmentHistory].
diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/environments/client.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/environments/client.py
index 5acfe0b3d8de..31600a28ba8e 100644
--- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/environments/client.py
+++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/environments/client.py
@@ -116,6 +116,22 @@ def _get_default_mtls_endpoint(api_endpoint):
DEFAULT_ENDPOINT
)
+ @classmethod
+ def from_service_account_info(cls, info: dict, *args, **kwargs):
+ """Creates an instance of this client using the provided credentials info.
+
+ Args:
+ info (dict): The service account private key info.
+ args: Additional arguments to pass to the constructor.
+ kwargs: Additional arguments to pass to the constructor.
+
+ Returns:
+ EnvironmentsClient: The constructed client.
+ """
+ credentials = service_account.Credentials.from_service_account_info(info)
+ kwargs["credentials"] = credentials
+ return cls(*args, **kwargs)
+
@classmethod
def from_service_account_file(cls, filename: str, *args, **kwargs):
"""Creates an instance of this client using the provided credentials
@@ -128,7 +144,7 @@ def from_service_account_file(cls, filename: str, *args, **kwargs):
kwargs: Additional arguments to pass to the constructor.
Returns:
- {@api.name}: The constructed client.
+ EnvironmentsClient: The constructed client.
"""
credentials = service_account.Credentials.from_service_account_file(filename)
kwargs["credentials"] = credentials
@@ -256,10 +272,10 @@ def __init__(
credentials identify the application to the service; if none
are specified, the client will attempt to ascertain the
credentials from the environment.
- transport (Union[str, ~.EnvironmentsTransport]): The
+ transport (Union[str, EnvironmentsTransport]): The
transport to use. If set to None, a transport is chosen
automatically.
- client_options (client_options_lib.ClientOptions): Custom options for the
+ client_options (google.api_core.client_options.ClientOptions): Custom options for the
client. It won't take effect if a ``transport`` instance is provided.
(1) The ``api_endpoint`` property can be used to override the
default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT
@@ -295,21 +311,17 @@ def __init__(
util.strtobool(os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false"))
)
- ssl_credentials = None
+ client_cert_source_func = None
is_mtls = False
if use_client_cert:
if client_options.client_cert_source:
- import grpc # type: ignore
-
- cert, key = client_options.client_cert_source()
- ssl_credentials = grpc.ssl_channel_credentials(
- certificate_chain=cert, private_key=key
- )
is_mtls = True
+ client_cert_source_func = client_options.client_cert_source
else:
- creds = SslCredentials()
- is_mtls = creds.is_mtls
- ssl_credentials = creds.ssl_credentials if is_mtls else None
+ is_mtls = mtls.has_default_client_cert_source()
+ client_cert_source_func = (
+ mtls.default_client_cert_source() if is_mtls else None
+ )
# Figure out which api endpoint to use.
if client_options.api_endpoint is not None:
@@ -352,7 +364,7 @@ def __init__(
credentials_file=client_options.credentials_file,
host=api_endpoint,
scopes=client_options.scopes,
- ssl_channel_credentials=ssl_credentials,
+ client_cert_source_for_mtls=client_cert_source_func,
quota_project_id=client_options.quota_project_id,
client_info=client_info,
)
@@ -370,14 +382,15 @@ def list_environments(
[Agent][google.cloud.dialogflow.cx.v3.Agent].
Args:
- request (:class:`~.environment.ListEnvironmentsRequest`):
+ request (google.cloud.dialogflowcx_v3.types.ListEnvironmentsRequest):
The request object. The request message for
[Environments.ListEnvironments][google.cloud.dialogflow.cx.v3.Environments.ListEnvironments].
- parent (:class:`str`):
+ parent (str):
Required. The
[Agent][google.cloud.dialogflow.cx.v3.Agent] to list all
environments for. Format:
``projects//locations//agents/``.
+
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -389,7 +402,7 @@ def list_environments(
sent along with the request as metadata.
Returns:
- ~.pagers.ListEnvironmentsPager:
+ google.cloud.dialogflowcx_v3.services.environments.pagers.ListEnvironmentsPager:
The response message for
[Environments.ListEnvironments][google.cloud.dialogflow.cx.v3.Environments.ListEnvironments].
@@ -455,14 +468,15 @@ def get_environment(
[Environment][google.cloud.dialogflow.cx.v3.Environment].
Args:
- request (:class:`~.environment.GetEnvironmentRequest`):
+ request (google.cloud.dialogflowcx_v3.types.GetEnvironmentRequest):
The request object. The request message for
[Environments.GetEnvironment][google.cloud.dialogflow.cx.v3.Environments.GetEnvironment].
- name (:class:`str`):
+ name (str):
Required. The name of the
[Environment][google.cloud.dialogflow.cx.v3.Environment].
Format:
``projects//locations//agents//environments/``.
+
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -474,7 +488,7 @@ def get_environment(
sent along with the request as metadata.
Returns:
- ~.environment.Environment:
+ google.cloud.dialogflowcx_v3.types.Environment:
Represents an environment for an
agent. You can create multiple versions
of your agent and publish them to
@@ -546,20 +560,21 @@ def create_environment(
specified [Agent][google.cloud.dialogflow.cx.v3.Agent].
Args:
- request (:class:`~.gcdc_environment.CreateEnvironmentRequest`):
+ request (google.cloud.dialogflowcx_v3.types.CreateEnvironmentRequest):
The request object. The request message for
[Environments.CreateEnvironment][google.cloud.dialogflow.cx.v3.Environments.CreateEnvironment].
- parent (:class:`str`):
+ parent (str):
Required. The
[Agent][google.cloud.dialogflow.cx.v3.Agent] to create
an
[Environment][google.cloud.dialogflow.cx.v3.Environment]
for. Format:
``projects//locations//agents/``.
+
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
- environment (:class:`~.gcdc_environment.Environment`):
+ environment (google.cloud.dialogflowcx_v3.types.Environment):
Required. The environment to create.
This corresponds to the ``environment`` field
on the ``request`` instance; if ``request`` is provided, this
@@ -572,21 +587,20 @@ def create_environment(
sent along with the request as metadata.
Returns:
- ~.operation.Operation:
+ google.api_core.operation.Operation:
An object representing a long-running operation.
- The result type for the operation will be
- :class:``~.gcdc_environment.Environment``: 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.
+ The result type for the operation will be :class:`google.cloud.dialogflowcx_v3.types.Environment` 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.
"""
# Create or coerce a protobuf request object.
@@ -652,17 +666,18 @@ def update_environment(
[Environment][google.cloud.dialogflow.cx.v3.Environment].
Args:
- request (:class:`~.gcdc_environment.UpdateEnvironmentRequest`):
+ request (google.cloud.dialogflowcx_v3.types.UpdateEnvironmentRequest):
The request object. The request message for
[Environments.UpdateEnvironment][google.cloud.dialogflow.cx.v3.Environments.UpdateEnvironment].
- environment (:class:`~.gcdc_environment.Environment`):
+ environment (google.cloud.dialogflowcx_v3.types.Environment):
Required. The environment to update.
This corresponds to the ``environment`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
- update_mask (:class:`~.field_mask.FieldMask`):
+ update_mask (google.protobuf.field_mask_pb2.FieldMask):
Required. The mask to control which
fields get updated.
+
This corresponds to the ``update_mask`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -674,21 +689,20 @@ def update_environment(
sent along with the request as metadata.
Returns:
- ~.operation.Operation:
+ google.api_core.operation.Operation:
An object representing a long-running operation.
- The result type for the operation will be
- :class:``~.gcdc_environment.Environment``: 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.
+ The result type for the operation will be :class:`google.cloud.dialogflowcx_v3.types.Environment` 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.
"""
# Create or coerce a protobuf request object.
@@ -755,14 +769,15 @@ def delete_environment(
[Environment][google.cloud.dialogflow.cx.v3.Environment].
Args:
- request (:class:`~.environment.DeleteEnvironmentRequest`):
+ request (google.cloud.dialogflowcx_v3.types.DeleteEnvironmentRequest):
The request object. The request message for
[Environments.DeleteEnvironment][google.cloud.dialogflow.cx.v3.Environments.DeleteEnvironment].
- name (:class:`str`):
+ name (str):
Required. The name of the
[Environment][google.cloud.dialogflow.cx.v3.Environment]
to delete. Format:
``projects//locations//agents//environments/``.
+
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -824,13 +839,14 @@ def lookup_environment_history(
[Environment][google.cloud.dialogflow.cx.v3.Environment].
Args:
- request (:class:`~.environment.LookupEnvironmentHistoryRequest`):
+ request (google.cloud.dialogflowcx_v3.types.LookupEnvironmentHistoryRequest):
The request object. The request message for
[Environments.LookupEnvironmentHistory][google.cloud.dialogflow.cx.v3.Environments.LookupEnvironmentHistory].
- name (:class:`str`):
+ name (str):
Required. Resource name of the environment to look up
the history for. Format:
``projects//locations//agents//environments/``.
+
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -842,7 +858,7 @@ def lookup_environment_history(
sent along with the request as metadata.
Returns:
- ~.pagers.LookupEnvironmentHistoryPager:
+ google.cloud.dialogflowcx_v3.services.environments.pagers.LookupEnvironmentHistoryPager:
The response message for
[Environments.LookupEnvironmentHistory][google.cloud.dialogflow.cx.v3.Environments.LookupEnvironmentHistory].
diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/environments/pagers.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/environments/pagers.py
index ce8409a4c5d3..04e1b444d312 100644
--- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/environments/pagers.py
+++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/environments/pagers.py
@@ -15,7 +15,16 @@
# limitations under the License.
#
-from typing import Any, AsyncIterable, Awaitable, Callable, Iterable, Sequence, Tuple
+from typing import (
+ Any,
+ AsyncIterable,
+ Awaitable,
+ Callable,
+ Iterable,
+ Sequence,
+ Tuple,
+ Optional,
+)
from google.cloud.dialogflowcx_v3.types import environment
@@ -24,7 +33,7 @@ class ListEnvironmentsPager:
"""A pager for iterating through ``list_environments`` requests.
This class thinly wraps an initial
- :class:`~.environment.ListEnvironmentsResponse` object, and
+ :class:`google.cloud.dialogflowcx_v3.types.ListEnvironmentsResponse` object, and
provides an ``__iter__`` method to iterate through its
``environments`` field.
@@ -33,7 +42,7 @@ class ListEnvironmentsPager:
through the ``environments`` field on the
corresponding responses.
- All the usual :class:`~.environment.ListEnvironmentsResponse`
+ All the usual :class:`google.cloud.dialogflowcx_v3.types.ListEnvironmentsResponse`
attributes are available on the pager. If multiple requests are made, only
the most recent response is retained, and thus used for attribute lookup.
"""
@@ -51,9 +60,9 @@ def __init__(
Args:
method (Callable): The method that was originally called, and
which instantiated this pager.
- request (:class:`~.environment.ListEnvironmentsRequest`):
+ request (google.cloud.dialogflowcx_v3.types.ListEnvironmentsRequest):
The initial request object.
- response (:class:`~.environment.ListEnvironmentsResponse`):
+ response (google.cloud.dialogflowcx_v3.types.ListEnvironmentsResponse):
The initial response object.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
@@ -86,7 +95,7 @@ class ListEnvironmentsAsyncPager:
"""A pager for iterating through ``list_environments`` requests.
This class thinly wraps an initial
- :class:`~.environment.ListEnvironmentsResponse` object, and
+ :class:`google.cloud.dialogflowcx_v3.types.ListEnvironmentsResponse` object, and
provides an ``__aiter__`` method to iterate through its
``environments`` field.
@@ -95,7 +104,7 @@ class ListEnvironmentsAsyncPager:
through the ``environments`` field on the
corresponding responses.
- All the usual :class:`~.environment.ListEnvironmentsResponse`
+ All the usual :class:`google.cloud.dialogflowcx_v3.types.ListEnvironmentsResponse`
attributes are available on the pager. If multiple requests are made, only
the most recent response is retained, and thus used for attribute lookup.
"""
@@ -113,9 +122,9 @@ def __init__(
Args:
method (Callable): The method that was originally called, and
which instantiated this pager.
- request (:class:`~.environment.ListEnvironmentsRequest`):
+ request (google.cloud.dialogflowcx_v3.types.ListEnvironmentsRequest):
The initial request object.
- response (:class:`~.environment.ListEnvironmentsResponse`):
+ response (google.cloud.dialogflowcx_v3.types.ListEnvironmentsResponse):
The initial response object.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
@@ -152,7 +161,7 @@ class LookupEnvironmentHistoryPager:
"""A pager for iterating through ``lookup_environment_history`` requests.
This class thinly wraps an initial
- :class:`~.environment.LookupEnvironmentHistoryResponse` object, and
+ :class:`google.cloud.dialogflowcx_v3.types.LookupEnvironmentHistoryResponse` object, and
provides an ``__iter__`` method to iterate through its
``environments`` field.
@@ -161,7 +170,7 @@ class LookupEnvironmentHistoryPager:
through the ``environments`` field on the
corresponding responses.
- All the usual :class:`~.environment.LookupEnvironmentHistoryResponse`
+ All the usual :class:`google.cloud.dialogflowcx_v3.types.LookupEnvironmentHistoryResponse`
attributes are available on the pager. If multiple requests are made, only
the most recent response is retained, and thus used for attribute lookup.
"""
@@ -179,9 +188,9 @@ def __init__(
Args:
method (Callable): The method that was originally called, and
which instantiated this pager.
- request (:class:`~.environment.LookupEnvironmentHistoryRequest`):
+ request (google.cloud.dialogflowcx_v3.types.LookupEnvironmentHistoryRequest):
The initial request object.
- response (:class:`~.environment.LookupEnvironmentHistoryResponse`):
+ response (google.cloud.dialogflowcx_v3.types.LookupEnvironmentHistoryResponse):
The initial response object.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
@@ -214,7 +223,7 @@ class LookupEnvironmentHistoryAsyncPager:
"""A pager for iterating through ``lookup_environment_history`` requests.
This class thinly wraps an initial
- :class:`~.environment.LookupEnvironmentHistoryResponse` object, and
+ :class:`google.cloud.dialogflowcx_v3.types.LookupEnvironmentHistoryResponse` object, and
provides an ``__aiter__`` method to iterate through its
``environments`` field.
@@ -223,7 +232,7 @@ class LookupEnvironmentHistoryAsyncPager:
through the ``environments`` field on the
corresponding responses.
- All the usual :class:`~.environment.LookupEnvironmentHistoryResponse`
+ All the usual :class:`google.cloud.dialogflowcx_v3.types.LookupEnvironmentHistoryResponse`
attributes are available on the pager. If multiple requests are made, only
the most recent response is retained, and thus used for attribute lookup.
"""
@@ -241,9 +250,9 @@ def __init__(
Args:
method (Callable): The method that was originally called, and
which instantiated this pager.
- request (:class:`~.environment.LookupEnvironmentHistoryRequest`):
+ request (google.cloud.dialogflowcx_v3.types.LookupEnvironmentHistoryRequest):
The initial request object.
- response (:class:`~.environment.LookupEnvironmentHistoryResponse`):
+ response (google.cloud.dialogflowcx_v3.types.LookupEnvironmentHistoryResponse):
The initial response object.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/environments/transports/grpc.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/environments/transports/grpc.py
index 2ee7c39d77c9..e73d51a4e702 100644
--- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/environments/transports/grpc.py
+++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/environments/transports/grpc.py
@@ -62,6 +62,7 @@ def __init__(
api_mtls_endpoint: str = None,
client_cert_source: Callable[[], Tuple[bytes, bytes]] = None,
ssl_channel_credentials: grpc.ChannelCredentials = None,
+ client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None,
quota_project_id: Optional[str] = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
) -> None:
@@ -92,6 +93,10 @@ def __init__(
``api_mtls_endpoint`` is None.
ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials
for grpc channel. It is ignored if ``channel`` is provided.
+ client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]):
+ A callback to provide client certificate bytes and private key bytes,
+ both in PEM format. It is used to configure mutual TLS channel. It is
+ ignored if ``channel`` or ``ssl_channel_credentials`` is provided.
quota_project_id (Optional[str]): An optional project to use for billing
and quota.
client_info (google.api_core.gapic_v1.client_info.ClientInfo):
@@ -108,6 +113,11 @@ def __init__(
"""
self._ssl_channel_credentials = ssl_channel_credentials
+ if api_mtls_endpoint:
+ warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning)
+ if client_cert_source:
+ warnings.warn("client_cert_source is deprecated", DeprecationWarning)
+
if channel:
# Sanity check: Ensure that channel and credentials are not both
# provided.
@@ -117,11 +127,6 @@ def __init__(
self._grpc_channel = channel
self._ssl_channel_credentials = None
elif api_mtls_endpoint:
- warnings.warn(
- "api_mtls_endpoint and client_cert_source are deprecated",
- DeprecationWarning,
- )
-
host = (
api_mtls_endpoint
if ":" in api_mtls_endpoint
@@ -165,12 +170,18 @@ def __init__(
scopes=self.AUTH_SCOPES, quota_project_id=quota_project_id
)
+ if client_cert_source_for_mtls and not ssl_channel_credentials:
+ cert, key = client_cert_source_for_mtls()
+ self._ssl_channel_credentials = grpc.ssl_channel_credentials(
+ certificate_chain=cert, private_key=key
+ )
+
# create a new channel. The provided one is ignored.
self._grpc_channel = type(self).create_channel(
host,
credentials=credentials,
credentials_file=credentials_file,
- ssl_credentials=ssl_channel_credentials,
+ ssl_credentials=self._ssl_channel_credentials,
scopes=scopes or self.AUTH_SCOPES,
quota_project_id=quota_project_id,
options=[
diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/environments/transports/grpc_asyncio.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/environments/transports/grpc_asyncio.py
index 4d0a66ca7541..b3b671e0d909 100644
--- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/environments/transports/grpc_asyncio.py
+++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/environments/transports/grpc_asyncio.py
@@ -106,6 +106,7 @@ def __init__(
api_mtls_endpoint: str = None,
client_cert_source: Callable[[], Tuple[bytes, bytes]] = None,
ssl_channel_credentials: grpc.ChannelCredentials = None,
+ client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None,
quota_project_id=None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
) -> None:
@@ -137,6 +138,10 @@ def __init__(
``api_mtls_endpoint`` is None.
ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials
for grpc channel. It is ignored if ``channel`` is provided.
+ client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]):
+ A callback to provide client certificate bytes and private key bytes,
+ both in PEM format. It is used to configure mutual TLS channel. It is
+ ignored if ``channel`` or ``ssl_channel_credentials`` is provided.
quota_project_id (Optional[str]): An optional project to use for billing
and quota.
client_info (google.api_core.gapic_v1.client_info.ClientInfo):
@@ -153,6 +158,11 @@ def __init__(
"""
self._ssl_channel_credentials = ssl_channel_credentials
+ if api_mtls_endpoint:
+ warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning)
+ if client_cert_source:
+ warnings.warn("client_cert_source is deprecated", DeprecationWarning)
+
if channel:
# Sanity check: Ensure that channel and credentials are not both
# provided.
@@ -162,11 +172,6 @@ def __init__(
self._grpc_channel = channel
self._ssl_channel_credentials = None
elif api_mtls_endpoint:
- warnings.warn(
- "api_mtls_endpoint and client_cert_source are deprecated",
- DeprecationWarning,
- )
-
host = (
api_mtls_endpoint
if ":" in api_mtls_endpoint
@@ -210,12 +215,18 @@ def __init__(
scopes=self.AUTH_SCOPES, quota_project_id=quota_project_id
)
+ if client_cert_source_for_mtls and not ssl_channel_credentials:
+ cert, key = client_cert_source_for_mtls()
+ self._ssl_channel_credentials = grpc.ssl_channel_credentials(
+ certificate_chain=cert, private_key=key
+ )
+
# create a new channel. The provided one is ignored.
self._grpc_channel = type(self).create_channel(
host,
credentials=credentials,
credentials_file=credentials_file,
- ssl_credentials=ssl_channel_credentials,
+ ssl_credentials=self._ssl_channel_credentials,
scopes=scopes or self.AUTH_SCOPES,
quota_project_id=quota_project_id,
options=[
diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/experiments/async_client.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/experiments/async_client.py
index 137f02509c8c..045685d2cf41 100644
--- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/experiments/async_client.py
+++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/experiments/async_client.py
@@ -80,7 +80,36 @@ class ExperimentsAsyncClient:
ExperimentsClient.parse_common_location_path
)
- from_service_account_file = ExperimentsClient.from_service_account_file
+ @classmethod
+ def from_service_account_info(cls, info: dict, *args, **kwargs):
+ """Creates an instance of this client using the provided credentials info.
+
+ Args:
+ info (dict): The service account private key info.
+ args: Additional arguments to pass to the constructor.
+ kwargs: Additional arguments to pass to the constructor.
+
+ Returns:
+ ExperimentsAsyncClient: The constructed client.
+ """
+ return ExperimentsClient.from_service_account_info.__func__(ExperimentsAsyncClient, info, *args, **kwargs) # type: ignore
+
+ @classmethod
+ def from_service_account_file(cls, filename: str, *args, **kwargs):
+ """Creates an instance of this client using the provided credentials
+ file.
+
+ Args:
+ filename (str): The path to the service account private key json
+ file.
+ args: Additional arguments to pass to the constructor.
+ kwargs: Additional arguments to pass to the constructor.
+
+ Returns:
+ ExperimentsAsyncClient: The constructed client.
+ """
+ return ExperimentsClient.from_service_account_file.__func__(ExperimentsAsyncClient, filename, *args, **kwargs) # type: ignore
+
from_service_account_json = from_service_account_file
@property
@@ -157,7 +186,7 @@ async def list_experiments(
[Environment][google.cloud.dialogflow.cx.v3.Environment].
Args:
- request (:class:`~.experiment.ListExperimentsRequest`):
+ request (:class:`google.cloud.dialogflowcx_v3.types.ListExperimentsRequest`):
The request object. The request message for
[Experiments.ListExperiments][google.cloud.dialogflow.cx.v3.Experiments.ListExperiments].
parent (:class:`str`):
@@ -165,6 +194,7 @@ async def list_experiments(
[Environment][google.cloud.dialogflow.cx.v3.Environment]
to list all environments for. Format:
``projects//locations//agents//environments/``.
+
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -176,7 +206,7 @@ async def list_experiments(
sent along with the request as metadata.
Returns:
- ~.pagers.ListExperimentsAsyncPager:
+ google.cloud.dialogflowcx_v3.services.experiments.pagers.ListExperimentsAsyncPager:
The response message for
[Experiments.ListExperiments][google.cloud.dialogflow.cx.v3.Experiments.ListExperiments].
@@ -241,7 +271,7 @@ async def get_experiment(
[Experiment][google.cloud.dialogflow.cx.v3.Experiment].
Args:
- request (:class:`~.experiment.GetExperimentRequest`):
+ request (:class:`google.cloud.dialogflowcx_v3.types.GetExperimentRequest`):
The request object. The request message for
[Experiments.GetExperiment][google.cloud.dialogflow.cx.v3.Experiments.GetExperiment].
name (:class:`str`):
@@ -249,6 +279,7 @@ async def get_experiment(
[Environment][google.cloud.dialogflow.cx.v3.Environment].
Format:
``projects//locations//agents//environments//experiments/``.
+
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -260,9 +291,9 @@ async def get_experiment(
sent along with the request as metadata.
Returns:
- ~.experiment.Experiment:
+ google.cloud.dialogflowcx_v3.types.Experiment:
Represents an experiment in an
- environment. Next ID: 13
+ environment.
"""
# Create or coerce a protobuf request object.
@@ -319,7 +350,7 @@ async def create_experiment(
[Environment][google.cloud.dialogflow.cx.v3.Environment].
Args:
- request (:class:`~.gcdc_experiment.CreateExperimentRequest`):
+ request (:class:`google.cloud.dialogflowcx_v3.types.CreateExperimentRequest`):
The request object. The request message for
[Experiments.CreateExperiment][google.cloud.dialogflow.cx.v3.Experiments.CreateExperiment].
parent (:class:`str`):
@@ -329,10 +360,11 @@ async def create_experiment(
[Environment][google.cloud.dialogflow.cx.v3.Environment]
for. Format:
``projects//locations//agents//environments/``.
+
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
- experiment (:class:`~.gcdc_experiment.Experiment`):
+ experiment (:class:`google.cloud.dialogflowcx_v3.types.Experiment`):
Required. The experiment to create.
This corresponds to the ``experiment`` field
on the ``request`` instance; if ``request`` is provided, this
@@ -345,9 +377,9 @@ async def create_experiment(
sent along with the request as metadata.
Returns:
- ~.gcdc_experiment.Experiment:
+ google.cloud.dialogflowcx_v3.types.Experiment:
Represents an experiment in an
- environment. Next ID: 13
+ environment.
"""
# Create or coerce a protobuf request object.
@@ -404,17 +436,18 @@ async def update_experiment(
[Experiment][google.cloud.dialogflow.cx.v3.Experiment].
Args:
- request (:class:`~.gcdc_experiment.UpdateExperimentRequest`):
+ request (:class:`google.cloud.dialogflowcx_v3.types.UpdateExperimentRequest`):
The request object. The request message for
[Experiments.UpdateExperiment][google.cloud.dialogflow.cx.v3.Experiments.UpdateExperiment].
- experiment (:class:`~.gcdc_experiment.Experiment`):
+ experiment (:class:`google.cloud.dialogflowcx_v3.types.Experiment`):
Required. The experiment to update.
This corresponds to the ``experiment`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
- update_mask (:class:`~.field_mask.FieldMask`):
+ update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`):
Required. The mask to control which
fields get updated.
+
This corresponds to the ``update_mask`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -426,9 +459,9 @@ async def update_experiment(
sent along with the request as metadata.
Returns:
- ~.gcdc_experiment.Experiment:
+ google.cloud.dialogflowcx_v3.types.Experiment:
Represents an experiment in an
- environment. Next ID: 13
+ environment.
"""
# Create or coerce a protobuf request object.
@@ -486,7 +519,7 @@ async def delete_experiment(
[Experiment][google.cloud.dialogflow.cx.v3.Experiment].
Args:
- request (:class:`~.experiment.DeleteExperimentRequest`):
+ request (:class:`google.cloud.dialogflowcx_v3.types.DeleteExperimentRequest`):
The request object. The request message for
[Experiments.DeleteExperiment][google.cloud.dialogflow.cx.v3.Experiments.DeleteExperiment].
name (:class:`str`):
@@ -494,6 +527,7 @@ async def delete_experiment(
[Environment][google.cloud.dialogflow.cx.v3.Environment]
to delete. Format:
``projects//locations//agents//environments//experiments/``.
+
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -555,13 +589,14 @@ async def start_experiment(
only changes the state of experiment from PENDING to RUNNING.
Args:
- request (:class:`~.experiment.StartExperimentRequest`):
+ request (:class:`google.cloud.dialogflowcx_v3.types.StartExperimentRequest`):
The request object. The request message for
[Experiments.StartExperiment][google.cloud.dialogflow.cx.v3.Experiments.StartExperiment].
name (:class:`str`):
Required. Resource name of the experiment to start.
Format:
``projects//locations//agents//environments//experiments/``.
+
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -573,9 +608,9 @@ async def start_experiment(
sent along with the request as metadata.
Returns:
- ~.experiment.Experiment:
+ google.cloud.dialogflowcx_v3.types.Experiment:
Represents an experiment in an
- environment. Next ID: 13
+ environment.
"""
# Create or coerce a protobuf request object.
@@ -630,13 +665,14 @@ async def stop_experiment(
only changes the state of experiment from RUNNING to DONE.
Args:
- request (:class:`~.experiment.StopExperimentRequest`):
+ request (:class:`google.cloud.dialogflowcx_v3.types.StopExperimentRequest`):
The request object. The request message for
[Experiments.StopExperiment][google.cloud.dialogflow.cx.v3.Experiments.StopExperiment].
name (:class:`str`):
Required. Resource name of the experiment to stop.
Format:
``projects//locations//agents//environments//experiments/``.
+
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -648,9 +684,9 @@ async def stop_experiment(
sent along with the request as metadata.
Returns:
- ~.experiment.Experiment:
+ google.cloud.dialogflowcx_v3.types.Experiment:
Represents an experiment in an
- environment. Next ID: 13
+ environment.
"""
# Create or coerce a protobuf request object.
diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/experiments/client.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/experiments/client.py
index 9e0984a87762..2b3e5ea4fc34 100644
--- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/experiments/client.py
+++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/experiments/client.py
@@ -114,6 +114,22 @@ def _get_default_mtls_endpoint(api_endpoint):
DEFAULT_ENDPOINT
)
+ @classmethod
+ def from_service_account_info(cls, info: dict, *args, **kwargs):
+ """Creates an instance of this client using the provided credentials info.
+
+ Args:
+ info (dict): The service account private key info.
+ args: Additional arguments to pass to the constructor.
+ kwargs: Additional arguments to pass to the constructor.
+
+ Returns:
+ ExperimentsClient: The constructed client.
+ """
+ credentials = service_account.Credentials.from_service_account_info(info)
+ kwargs["credentials"] = credentials
+ return cls(*args, **kwargs)
+
@classmethod
def from_service_account_file(cls, filename: str, *args, **kwargs):
"""Creates an instance of this client using the provided credentials
@@ -126,7 +142,7 @@ def from_service_account_file(cls, filename: str, *args, **kwargs):
kwargs: Additional arguments to pass to the constructor.
Returns:
- {@api.name}: The constructed client.
+ ExperimentsClient: The constructed client.
"""
credentials = service_account.Credentials.from_service_account_file(filename)
kwargs["credentials"] = credentials
@@ -258,10 +274,10 @@ def __init__(
credentials identify the application to the service; if none
are specified, the client will attempt to ascertain the
credentials from the environment.
- transport (Union[str, ~.ExperimentsTransport]): The
+ transport (Union[str, ExperimentsTransport]): The
transport to use. If set to None, a transport is chosen
automatically.
- client_options (client_options_lib.ClientOptions): Custom options for the
+ client_options (google.api_core.client_options.ClientOptions): Custom options for the
client. It won't take effect if a ``transport`` instance is provided.
(1) The ``api_endpoint`` property can be used to override the
default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT
@@ -297,21 +313,17 @@ def __init__(
util.strtobool(os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false"))
)
- ssl_credentials = None
+ client_cert_source_func = None
is_mtls = False
if use_client_cert:
if client_options.client_cert_source:
- import grpc # type: ignore
-
- cert, key = client_options.client_cert_source()
- ssl_credentials = grpc.ssl_channel_credentials(
- certificate_chain=cert, private_key=key
- )
is_mtls = True
+ client_cert_source_func = client_options.client_cert_source
else:
- creds = SslCredentials()
- is_mtls = creds.is_mtls
- ssl_credentials = creds.ssl_credentials if is_mtls else None
+ is_mtls = mtls.has_default_client_cert_source()
+ client_cert_source_func = (
+ mtls.default_client_cert_source() if is_mtls else None
+ )
# Figure out which api endpoint to use.
if client_options.api_endpoint is not None:
@@ -354,7 +366,7 @@ def __init__(
credentials_file=client_options.credentials_file,
host=api_endpoint,
scopes=client_options.scopes,
- ssl_channel_credentials=ssl_credentials,
+ client_cert_source_for_mtls=client_cert_source_func,
quota_project_id=client_options.quota_project_id,
client_info=client_info,
)
@@ -372,14 +384,15 @@ def list_experiments(
[Environment][google.cloud.dialogflow.cx.v3.Environment].
Args:
- request (:class:`~.experiment.ListExperimentsRequest`):
+ request (google.cloud.dialogflowcx_v3.types.ListExperimentsRequest):
The request object. The request message for
[Experiments.ListExperiments][google.cloud.dialogflow.cx.v3.Experiments.ListExperiments].
- parent (:class:`str`):
+ parent (str):
Required. The
[Environment][google.cloud.dialogflow.cx.v3.Environment]
to list all environments for. Format:
``projects//locations//agents//environments/``.
+
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -391,7 +404,7 @@ def list_experiments(
sent along with the request as metadata.
Returns:
- ~.pagers.ListExperimentsPager:
+ google.cloud.dialogflowcx_v3.services.experiments.pagers.ListExperimentsPager:
The response message for
[Experiments.ListExperiments][google.cloud.dialogflow.cx.v3.Experiments.ListExperiments].
@@ -457,14 +470,15 @@ def get_experiment(
[Experiment][google.cloud.dialogflow.cx.v3.Experiment].
Args:
- request (:class:`~.experiment.GetExperimentRequest`):
+ request (google.cloud.dialogflowcx_v3.types.GetExperimentRequest):
The request object. The request message for
[Experiments.GetExperiment][google.cloud.dialogflow.cx.v3.Experiments.GetExperiment].
- name (:class:`str`):
+ name (str):
Required. The name of the
[Environment][google.cloud.dialogflow.cx.v3.Environment].
Format:
``projects//locations//agents//environments//experiments/``.
+
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -476,9 +490,9 @@ def get_experiment(
sent along with the request as metadata.
Returns:
- ~.experiment.Experiment:
+ google.cloud.dialogflowcx_v3.types.Experiment:
Represents an experiment in an
- environment. Next ID: 13
+ environment.
"""
# Create or coerce a protobuf request object.
@@ -536,20 +550,21 @@ def create_experiment(
[Environment][google.cloud.dialogflow.cx.v3.Environment].
Args:
- request (:class:`~.gcdc_experiment.CreateExperimentRequest`):
+ request (google.cloud.dialogflowcx_v3.types.CreateExperimentRequest):
The request object. The request message for
[Experiments.CreateExperiment][google.cloud.dialogflow.cx.v3.Experiments.CreateExperiment].
- parent (:class:`str`):
+ parent (str):
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/``.
+
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
- experiment (:class:`~.gcdc_experiment.Experiment`):
+ experiment (google.cloud.dialogflowcx_v3.types.Experiment):
Required. The experiment to create.
This corresponds to the ``experiment`` field
on the ``request`` instance; if ``request`` is provided, this
@@ -562,9 +577,9 @@ def create_experiment(
sent along with the request as metadata.
Returns:
- ~.gcdc_experiment.Experiment:
+ google.cloud.dialogflowcx_v3.types.Experiment:
Represents an experiment in an
- environment. Next ID: 13
+ environment.
"""
# Create or coerce a protobuf request object.
@@ -622,17 +637,18 @@ def update_experiment(
[Experiment][google.cloud.dialogflow.cx.v3.Experiment].
Args:
- request (:class:`~.gcdc_experiment.UpdateExperimentRequest`):
+ request (google.cloud.dialogflowcx_v3.types.UpdateExperimentRequest):
The request object. The request message for
[Experiments.UpdateExperiment][google.cloud.dialogflow.cx.v3.Experiments.UpdateExperiment].
- experiment (:class:`~.gcdc_experiment.Experiment`):
+ experiment (google.cloud.dialogflowcx_v3.types.Experiment):
Required. The experiment to update.
This corresponds to the ``experiment`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
- update_mask (:class:`~.field_mask.FieldMask`):
+ update_mask (google.protobuf.field_mask_pb2.FieldMask):
Required. The mask to control which
fields get updated.
+
This corresponds to the ``update_mask`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -644,9 +660,9 @@ def update_experiment(
sent along with the request as metadata.
Returns:
- ~.gcdc_experiment.Experiment:
+ google.cloud.dialogflowcx_v3.types.Experiment:
Represents an experiment in an
- environment. Next ID: 13
+ environment.
"""
# Create or coerce a protobuf request object.
@@ -705,14 +721,15 @@ def delete_experiment(
[Experiment][google.cloud.dialogflow.cx.v3.Experiment].
Args:
- request (:class:`~.experiment.DeleteExperimentRequest`):
+ request (google.cloud.dialogflowcx_v3.types.DeleteExperimentRequest):
The request object. The request message for
[Experiments.DeleteExperiment][google.cloud.dialogflow.cx.v3.Experiments.DeleteExperiment].
- name (:class:`str`):
+ name (str):
Required. The name of the
[Environment][google.cloud.dialogflow.cx.v3.Environment]
to delete. Format:
``projects//locations//agents//environments//experiments/``.
+
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -775,13 +792,14 @@ def start_experiment(
only changes the state of experiment from PENDING to RUNNING.
Args:
- request (:class:`~.experiment.StartExperimentRequest`):
+ request (google.cloud.dialogflowcx_v3.types.StartExperimentRequest):
The request object. The request message for
[Experiments.StartExperiment][google.cloud.dialogflow.cx.v3.Experiments.StartExperiment].
- name (:class:`str`):
+ name (str):
Required. Resource name of the experiment to start.
Format:
``projects//locations//agents//environments//experiments/``.
+
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -793,9 +811,9 @@ def start_experiment(
sent along with the request as metadata.
Returns:
- ~.experiment.Experiment:
+ google.cloud.dialogflowcx_v3.types.Experiment:
Represents an experiment in an
- environment. Next ID: 13
+ environment.
"""
# Create or coerce a protobuf request object.
@@ -851,13 +869,14 @@ def stop_experiment(
only changes the state of experiment from RUNNING to DONE.
Args:
- request (:class:`~.experiment.StopExperimentRequest`):
+ request (google.cloud.dialogflowcx_v3.types.StopExperimentRequest):
The request object. The request message for
[Experiments.StopExperiment][google.cloud.dialogflow.cx.v3.Experiments.StopExperiment].
- name (:class:`str`):
+ name (str):
Required. Resource name of the experiment to stop.
Format:
``projects//locations//agents//environments//experiments/``.
+
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -869,9 +888,9 @@ def stop_experiment(
sent along with the request as metadata.
Returns:
- ~.experiment.Experiment:
+ google.cloud.dialogflowcx_v3.types.Experiment:
Represents an experiment in an
- environment. Next ID: 13
+ environment.
"""
# Create or coerce a protobuf request object.
diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/experiments/pagers.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/experiments/pagers.py
index 248a0d06fb6a..dbac252770fb 100644
--- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/experiments/pagers.py
+++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/experiments/pagers.py
@@ -15,7 +15,16 @@
# limitations under the License.
#
-from typing import Any, AsyncIterable, Awaitable, Callable, Iterable, Sequence, Tuple
+from typing import (
+ Any,
+ AsyncIterable,
+ Awaitable,
+ Callable,
+ Iterable,
+ Sequence,
+ Tuple,
+ Optional,
+)
from google.cloud.dialogflowcx_v3.types import experiment
@@ -24,7 +33,7 @@ class ListExperimentsPager:
"""A pager for iterating through ``list_experiments`` requests.
This class thinly wraps an initial
- :class:`~.experiment.ListExperimentsResponse` object, and
+ :class:`google.cloud.dialogflowcx_v3.types.ListExperimentsResponse` object, and
provides an ``__iter__`` method to iterate through its
``experiments`` field.
@@ -33,7 +42,7 @@ class ListExperimentsPager:
through the ``experiments`` field on the
corresponding responses.
- All the usual :class:`~.experiment.ListExperimentsResponse`
+ All the usual :class:`google.cloud.dialogflowcx_v3.types.ListExperimentsResponse`
attributes are available on the pager. If multiple requests are made, only
the most recent response is retained, and thus used for attribute lookup.
"""
@@ -51,9 +60,9 @@ def __init__(
Args:
method (Callable): The method that was originally called, and
which instantiated this pager.
- request (:class:`~.experiment.ListExperimentsRequest`):
+ request (google.cloud.dialogflowcx_v3.types.ListExperimentsRequest):
The initial request object.
- response (:class:`~.experiment.ListExperimentsResponse`):
+ response (google.cloud.dialogflowcx_v3.types.ListExperimentsResponse):
The initial response object.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
@@ -86,7 +95,7 @@ class ListExperimentsAsyncPager:
"""A pager for iterating through ``list_experiments`` requests.
This class thinly wraps an initial
- :class:`~.experiment.ListExperimentsResponse` object, and
+ :class:`google.cloud.dialogflowcx_v3.types.ListExperimentsResponse` object, and
provides an ``__aiter__`` method to iterate through its
``experiments`` field.
@@ -95,7 +104,7 @@ class ListExperimentsAsyncPager:
through the ``experiments`` field on the
corresponding responses.
- All the usual :class:`~.experiment.ListExperimentsResponse`
+ All the usual :class:`google.cloud.dialogflowcx_v3.types.ListExperimentsResponse`
attributes are available on the pager. If multiple requests are made, only
the most recent response is retained, and thus used for attribute lookup.
"""
@@ -113,9 +122,9 @@ def __init__(
Args:
method (Callable): The method that was originally called, and
which instantiated this pager.
- request (:class:`~.experiment.ListExperimentsRequest`):
+ request (google.cloud.dialogflowcx_v3.types.ListExperimentsRequest):
The initial request object.
- response (:class:`~.experiment.ListExperimentsResponse`):
+ response (google.cloud.dialogflowcx_v3.types.ListExperimentsResponse):
The initial response object.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/experiments/transports/grpc.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/experiments/transports/grpc.py
index 316128d29c47..369bbd4cce1c 100644
--- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/experiments/transports/grpc.py
+++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/experiments/transports/grpc.py
@@ -60,6 +60,7 @@ def __init__(
api_mtls_endpoint: str = None,
client_cert_source: Callable[[], Tuple[bytes, bytes]] = None,
ssl_channel_credentials: grpc.ChannelCredentials = None,
+ client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None,
quota_project_id: Optional[str] = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
) -> None:
@@ -90,6 +91,10 @@ def __init__(
``api_mtls_endpoint`` is None.
ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials
for grpc channel. It is ignored if ``channel`` is provided.
+ client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]):
+ A callback to provide client certificate bytes and private key bytes,
+ both in PEM format. It is used to configure mutual TLS channel. It is
+ ignored if ``channel`` or ``ssl_channel_credentials`` is provided.
quota_project_id (Optional[str]): An optional project to use for billing
and quota.
client_info (google.api_core.gapic_v1.client_info.ClientInfo):
@@ -106,6 +111,11 @@ def __init__(
"""
self._ssl_channel_credentials = ssl_channel_credentials
+ if api_mtls_endpoint:
+ warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning)
+ if client_cert_source:
+ warnings.warn("client_cert_source is deprecated", DeprecationWarning)
+
if channel:
# Sanity check: Ensure that channel and credentials are not both
# provided.
@@ -115,11 +125,6 @@ def __init__(
self._grpc_channel = channel
self._ssl_channel_credentials = None
elif api_mtls_endpoint:
- warnings.warn(
- "api_mtls_endpoint and client_cert_source are deprecated",
- DeprecationWarning,
- )
-
host = (
api_mtls_endpoint
if ":" in api_mtls_endpoint
@@ -163,12 +168,18 @@ def __init__(
scopes=self.AUTH_SCOPES, quota_project_id=quota_project_id
)
+ if client_cert_source_for_mtls and not ssl_channel_credentials:
+ cert, key = client_cert_source_for_mtls()
+ self._ssl_channel_credentials = grpc.ssl_channel_credentials(
+ certificate_chain=cert, private_key=key
+ )
+
# create a new channel. The provided one is ignored.
self._grpc_channel = type(self).create_channel(
host,
credentials=credentials,
credentials_file=credentials_file,
- ssl_credentials=ssl_channel_credentials,
+ ssl_credentials=self._ssl_channel_credentials,
scopes=scopes or self.AUTH_SCOPES,
quota_project_id=quota_project_id,
options=[
diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/experiments/transports/grpc_asyncio.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/experiments/transports/grpc_asyncio.py
index 43f613958a96..237cc21c44f4 100644
--- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/experiments/transports/grpc_asyncio.py
+++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/experiments/transports/grpc_asyncio.py
@@ -104,6 +104,7 @@ def __init__(
api_mtls_endpoint: str = None,
client_cert_source: Callable[[], Tuple[bytes, bytes]] = None,
ssl_channel_credentials: grpc.ChannelCredentials = None,
+ client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None,
quota_project_id=None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
) -> None:
@@ -135,6 +136,10 @@ def __init__(
``api_mtls_endpoint`` is None.
ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials
for grpc channel. It is ignored if ``channel`` is provided.
+ client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]):
+ A callback to provide client certificate bytes and private key bytes,
+ both in PEM format. It is used to configure mutual TLS channel. It is
+ ignored if ``channel`` or ``ssl_channel_credentials`` is provided.
quota_project_id (Optional[str]): An optional project to use for billing
and quota.
client_info (google.api_core.gapic_v1.client_info.ClientInfo):
@@ -151,6 +156,11 @@ def __init__(
"""
self._ssl_channel_credentials = ssl_channel_credentials
+ if api_mtls_endpoint:
+ warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning)
+ if client_cert_source:
+ warnings.warn("client_cert_source is deprecated", DeprecationWarning)
+
if channel:
# Sanity check: Ensure that channel and credentials are not both
# provided.
@@ -160,11 +170,6 @@ def __init__(
self._grpc_channel = channel
self._ssl_channel_credentials = None
elif api_mtls_endpoint:
- warnings.warn(
- "api_mtls_endpoint and client_cert_source are deprecated",
- DeprecationWarning,
- )
-
host = (
api_mtls_endpoint
if ":" in api_mtls_endpoint
@@ -208,12 +213,18 @@ def __init__(
scopes=self.AUTH_SCOPES, quota_project_id=quota_project_id
)
+ if client_cert_source_for_mtls and not ssl_channel_credentials:
+ cert, key = client_cert_source_for_mtls()
+ self._ssl_channel_credentials = grpc.ssl_channel_credentials(
+ certificate_chain=cert, private_key=key
+ )
+
# create a new channel. The provided one is ignored.
self._grpc_channel = type(self).create_channel(
host,
credentials=credentials,
credentials_file=credentials_file,
- ssl_credentials=ssl_channel_credentials,
+ ssl_credentials=self._ssl_channel_credentials,
scopes=scopes or self.AUTH_SCOPES,
quota_project_id=quota_project_id,
options=[
diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/flows/async_client.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/flows/async_client.py
index 31bfe6e60944..e0235fe88825 100644
--- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/flows/async_client.py
+++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/flows/async_client.py
@@ -34,9 +34,11 @@
from google.cloud.dialogflowcx_v3.types import flow
from google.cloud.dialogflowcx_v3.types import flow as gcdc_flow
from google.cloud.dialogflowcx_v3.types import page
+from google.cloud.dialogflowcx_v3.types import validation_message
from google.protobuf import empty_pb2 as empty # type: ignore
from google.protobuf import field_mask_pb2 as field_mask # type: ignore
from google.protobuf import struct_pb2 as struct # type: ignore
+from google.protobuf import timestamp_pb2 as timestamp # type: ignore
from .transports.base import FlowsTransport, DEFAULT_CLIENT_INFO
from .transports.grpc_asyncio import FlowsGrpcAsyncIOTransport
@@ -53,6 +55,10 @@ class FlowsAsyncClient:
flow_path = staticmethod(FlowsClient.flow_path)
parse_flow_path = staticmethod(FlowsClient.parse_flow_path)
+ flow_validation_result_path = staticmethod(FlowsClient.flow_validation_result_path)
+ parse_flow_validation_result_path = staticmethod(
+ FlowsClient.parse_flow_validation_result_path
+ )
intent_path = staticmethod(FlowsClient.intent_path)
parse_intent_path = staticmethod(FlowsClient.parse_intent_path)
page_path = staticmethod(FlowsClient.page_path)
@@ -79,7 +85,36 @@ class FlowsAsyncClient:
common_location_path = staticmethod(FlowsClient.common_location_path)
parse_common_location_path = staticmethod(FlowsClient.parse_common_location_path)
- from_service_account_file = FlowsClient.from_service_account_file
+ @classmethod
+ def from_service_account_info(cls, info: dict, *args, **kwargs):
+ """Creates an instance of this client using the provided credentials info.
+
+ Args:
+ info (dict): The service account private key info.
+ args: Additional arguments to pass to the constructor.
+ kwargs: Additional arguments to pass to the constructor.
+
+ Returns:
+ FlowsAsyncClient: The constructed client.
+ """
+ return FlowsClient.from_service_account_info.__func__(FlowsAsyncClient, info, *args, **kwargs) # type: ignore
+
+ @classmethod
+ def from_service_account_file(cls, filename: str, *args, **kwargs):
+ """Creates an instance of this client using the provided credentials
+ file.
+
+ Args:
+ filename (str): The path to the service account private key json
+ file.
+ args: Additional arguments to pass to the constructor.
+ kwargs: Additional arguments to pass to the constructor.
+
+ Returns:
+ FlowsAsyncClient: The constructed client.
+ """
+ return FlowsClient.from_service_account_file.__func__(FlowsAsyncClient, filename, *args, **kwargs) # type: ignore
+
from_service_account_json = from_service_account_file
@property
@@ -156,16 +191,17 @@ async def create_flow(
r"""Creates a flow in the specified agent.
Args:
- request (:class:`~.gcdc_flow.CreateFlowRequest`):
+ request (:class:`google.cloud.dialogflowcx_v3.types.CreateFlowRequest`):
The request object. The request message for
[Flows.CreateFlow][google.cloud.dialogflow.cx.v3.Flows.CreateFlow].
parent (:class:`str`):
Required. The agent to create a flow for. Format:
``projects//locations//agents/``.
+
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
- flow (:class:`~.gcdc_flow.Flow`):
+ flow (:class:`google.cloud.dialogflowcx_v3.types.Flow`):
Required. The flow to create.
This corresponds to the ``flow`` field
on the ``request`` instance; if ``request`` is provided, this
@@ -178,7 +214,7 @@ async def create_flow(
sent along with the request as metadata.
Returns:
- ~.gcdc_flow.Flow:
+ google.cloud.dialogflowcx_v3.types.Flow:
Flows represents the conversation
flows when you build your chatbot agent.
A flow consists of many pages connected
@@ -256,12 +292,13 @@ async def delete_flow(
r"""Deletes a specified flow.
Args:
- request (:class:`~.flow.DeleteFlowRequest`):
+ request (:class:`google.cloud.dialogflowcx_v3.types.DeleteFlowRequest`):
The request object. The request message for
[Flows.DeleteFlow][google.cloud.dialogflow.cx.v3.Flows.DeleteFlow].
name (:class:`str`):
Required. The name of the flow to delete. Format:
``projects//locations//agents//flows/``.
+
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -321,12 +358,13 @@ async def list_flows(
r"""Returns the list of all flows in the specified agent.
Args:
- request (:class:`~.flow.ListFlowsRequest`):
+ request (:class:`google.cloud.dialogflowcx_v3.types.ListFlowsRequest`):
The request object. The request message for
[Flows.ListFlows][google.cloud.dialogflow.cx.v3.Flows.ListFlows].
parent (:class:`str`):
Required. The agent containing the flows. Format:
``projects//locations//agents/``.
+
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -338,7 +376,7 @@ async def list_flows(
sent along with the request as metadata.
Returns:
- ~.pagers.ListFlowsAsyncPager:
+ google.cloud.dialogflowcx_v3.services.flows.pagers.ListFlowsAsyncPager:
The response message for
[Flows.ListFlows][google.cloud.dialogflow.cx.v3.Flows.ListFlows].
@@ -402,12 +440,13 @@ async def get_flow(
r"""Retrieves the specified flow.
Args:
- request (:class:`~.flow.GetFlowRequest`):
+ request (:class:`google.cloud.dialogflowcx_v3.types.GetFlowRequest`):
The request object. The response message for
[Flows.GetFlow][google.cloud.dialogflow.cx.v3.Flows.GetFlow].
name (:class:`str`):
Required. The name of the flow to get. Format:
``projects//locations//agents//flows/``.
+
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -419,7 +458,7 @@ async def get_flow(
sent along with the request as metadata.
Returns:
- ~.flow.Flow:
+ google.cloud.dialogflowcx_v3.types.Flow:
Flows represents the conversation
flows when you build your chatbot agent.
A flow consists of many pages connected
@@ -496,18 +535,19 @@ async def update_flow(
r"""Updates the specified flow.
Args:
- request (:class:`~.gcdc_flow.UpdateFlowRequest`):
+ request (:class:`google.cloud.dialogflowcx_v3.types.UpdateFlowRequest`):
The request object. The request message for
[Flows.UpdateFlow][google.cloud.dialogflow.cx.v3.Flows.UpdateFlow].
- flow (:class:`~.gcdc_flow.Flow`):
+ flow (:class:`google.cloud.dialogflowcx_v3.types.Flow`):
Required. The flow to update.
This corresponds to the ``flow`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
- update_mask (:class:`~.field_mask.FieldMask`):
+ update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`):
Required. The mask to control which fields get updated.
If ``update_mask`` is not specified, an error will be
returned.
+
This corresponds to the ``update_mask`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -519,7 +559,7 @@ async def update_flow(
sent along with the request as metadata.
Returns:
- ~.gcdc_flow.Flow:
+ google.cloud.dialogflowcx_v3.types.Flow:
Flows represents the conversation
flows when you build your chatbot agent.
A flow consists of many pages connected
@@ -600,12 +640,13 @@ async def train_flow(
'draft' environment is trained.
Args:
- request (:class:`~.flow.TrainFlowRequest`):
+ request (:class:`google.cloud.dialogflowcx_v3.types.TrainFlowRequest`):
The request object. The request message for
[Flows.TrainFlow][google.cloud.dialogflow.cx.v3.Flows.TrainFlow].
name (:class:`str`):
Required. The flow to train. Format:
``projects//locations//agents//flows/``.
+
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -617,24 +658,22 @@ async def train_flow(
sent along with the request as metadata.
Returns:
- ~.operation_async.AsyncOperation:
+ google.api_core.operation_async.AsyncOperation:
An object representing a long-running operation.
- The result type for the operation will be
- :class:``~.empty.Empty``: A generic empty message that
- you can re-use to avoid defining duplicated empty
- messages in your APIs. A typical example is to use it as
- the request or the response type of an API method. For
- instance:
+ The result type for the operation will be :class:`google.protobuf.empty_pb2.Empty` A generic empty message that you can re-use to avoid defining duplicated
+ empty messages in your APIs. A typical example is to
+ use it as the request or the response type of an API
+ method. For instance:
- ::
+ service Foo {
+ rpc Bar(google.protobuf.Empty) returns
+ (google.protobuf.Empty);
- service Foo {
- rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
- }
+ }
- The JSON representation for ``Empty`` is empty JSON
- object ``{}``.
+ The JSON representation for Empty is empty JSON
+ object {}.
"""
# Create or coerce a protobuf request object.
@@ -683,6 +722,134 @@ async def train_flow(
# Done; return the response.
return response
+ async def validate_flow(
+ self,
+ request: flow.ValidateFlowRequest = None,
+ *,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> flow.FlowValidationResult:
+ r"""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.
+
+ Args:
+ request (:class:`google.cloud.dialogflowcx_v3.types.ValidateFlowRequest`):
+ The request object. The request message for
+ [Flows.ValidateFlow][google.cloud.dialogflow.cx.v3.Flows.ValidateFlow].
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ google.cloud.dialogflowcx_v3.types.FlowValidationResult:
+ The response message for
+ [Flows.GetFlowValidationResult][google.cloud.dialogflow.cx.v3.Flows.GetFlowValidationResult].
+
+ """
+ # Create or coerce a protobuf request object.
+
+ request = flow.ValidateFlowRequest(request)
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method_async.wrap_method(
+ self._client._transport.validate_flow,
+ default_timeout=None,
+ client_info=DEFAULT_CLIENT_INFO,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ async def get_flow_validation_result(
+ self,
+ request: flow.GetFlowValidationResultRequest = None,
+ *,
+ name: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> flow.FlowValidationResult:
+ r"""Gets the latest flow validation result. Flow
+ validation is performed when ValidateFlow is called.
+
+ Args:
+ request (:class:`google.cloud.dialogflowcx_v3.types.GetFlowValidationResultRequest`):
+ The request object. The request message for
+ [Flows.GetFlowValidationResult][google.cloud.dialogflow.cx.v3.Flows.GetFlowValidationResult].
+ name (:class:`str`):
+ Required. The flow name. Format:
+ ``projects//locations//agents//flows//validationResult``.
+
+ This corresponds to the ``name`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ google.cloud.dialogflowcx_v3.types.FlowValidationResult:
+ The response message for
+ [Flows.GetFlowValidationResult][google.cloud.dialogflow.cx.v3.Flows.GetFlowValidationResult].
+
+ """
+ # Create or coerce a protobuf request object.
+ # Sanity check: If we got a request object, we should *not* have
+ # gotten any keyword arguments that map to the request.
+ has_flattened_params = any([name])
+ if request is not None and has_flattened_params:
+ raise ValueError(
+ "If the `request` argument is set, then none of "
+ "the individual field arguments should be set."
+ )
+
+ request = flow.GetFlowValidationResultRequest(request)
+
+ # If we have keyword arguments corresponding to fields on the
+ # request, apply these.
+
+ if name is not None:
+ request.name = name
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = gapic_v1.method_async.wrap_method(
+ self._client._transport.get_flow_validation_result,
+ default_timeout=None,
+ client_info=DEFAULT_CLIENT_INFO,
+ )
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
try:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/flows/client.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/flows/client.py
index b2c5b800d53c..6abaac842642 100644
--- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/flows/client.py
+++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/flows/client.py
@@ -38,9 +38,11 @@
from google.cloud.dialogflowcx_v3.types import flow
from google.cloud.dialogflowcx_v3.types import flow as gcdc_flow
from google.cloud.dialogflowcx_v3.types import page
+from google.cloud.dialogflowcx_v3.types import validation_message
from google.protobuf import empty_pb2 as empty # type: ignore
from google.protobuf import field_mask_pb2 as field_mask # type: ignore
from google.protobuf import struct_pb2 as struct # type: ignore
+from google.protobuf import timestamp_pb2 as timestamp # type: ignore
from .transports.base import FlowsTransport, DEFAULT_CLIENT_INFO
from .transports.grpc import FlowsGrpcTransport
@@ -115,6 +117,22 @@ def _get_default_mtls_endpoint(api_endpoint):
DEFAULT_ENDPOINT
)
+ @classmethod
+ def from_service_account_info(cls, info: dict, *args, **kwargs):
+ """Creates an instance of this client using the provided credentials info.
+
+ Args:
+ info (dict): The service account private key info.
+ args: Additional arguments to pass to the constructor.
+ kwargs: Additional arguments to pass to the constructor.
+
+ Returns:
+ FlowsClient: The constructed client.
+ """
+ credentials = service_account.Credentials.from_service_account_info(info)
+ kwargs["credentials"] = credentials
+ return cls(*args, **kwargs)
+
@classmethod
def from_service_account_file(cls, filename: str, *args, **kwargs):
"""Creates an instance of this client using the provided credentials
@@ -127,7 +145,7 @@ def from_service_account_file(cls, filename: str, *args, **kwargs):
kwargs: Additional arguments to pass to the constructor.
Returns:
- {@api.name}: The constructed client.
+ FlowsClient: The constructed client.
"""
credentials = service_account.Credentials.from_service_account_file(filename)
kwargs["credentials"] = credentials
@@ -160,6 +178,24 @@ def parse_flow_path(path: str) -> Dict[str, str]:
)
return m.groupdict() if m else {}
+ @staticmethod
+ def flow_validation_result_path(
+ project: str, location: str, agent: str, flow: str,
+ ) -> str:
+ """Return a fully-qualified flow_validation_result string."""
+ return "projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/validationResult".format(
+ project=project, location=location, agent=agent, flow=flow,
+ )
+
+ @staticmethod
+ def parse_flow_validation_result_path(path: str) -> Dict[str, str]:
+ """Parse a flow_validation_result path into its component segments."""
+ m = re.match(
+ r"^projects/(?P.+?)/locations/(?P.+?)/agents/(?P.+?)/flows/(?P.+?)/validationResult$",
+ path,
+ )
+ return m.groupdict() if m else {}
+
@staticmethod
def intent_path(project: str, location: str, agent: str, intent: str,) -> str:
"""Return a fully-qualified intent string."""
@@ -285,10 +321,10 @@ def __init__(
credentials identify the application to the service; if none
are specified, the client will attempt to ascertain the
credentials from the environment.
- transport (Union[str, ~.FlowsTransport]): The
+ transport (Union[str, FlowsTransport]): The
transport to use. If set to None, a transport is chosen
automatically.
- client_options (client_options_lib.ClientOptions): Custom options for the
+ client_options (google.api_core.client_options.ClientOptions): Custom options for the
client. It won't take effect if a ``transport`` instance is provided.
(1) The ``api_endpoint`` property can be used to override the
default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT
@@ -324,21 +360,17 @@ def __init__(
util.strtobool(os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false"))
)
- ssl_credentials = None
+ client_cert_source_func = None
is_mtls = False
if use_client_cert:
if client_options.client_cert_source:
- import grpc # type: ignore
-
- cert, key = client_options.client_cert_source()
- ssl_credentials = grpc.ssl_channel_credentials(
- certificate_chain=cert, private_key=key
- )
is_mtls = True
+ client_cert_source_func = client_options.client_cert_source
else:
- creds = SslCredentials()
- is_mtls = creds.is_mtls
- ssl_credentials = creds.ssl_credentials if is_mtls else None
+ is_mtls = mtls.has_default_client_cert_source()
+ client_cert_source_func = (
+ mtls.default_client_cert_source() if is_mtls else None
+ )
# Figure out which api endpoint to use.
if client_options.api_endpoint is not None:
@@ -381,7 +413,7 @@ def __init__(
credentials_file=client_options.credentials_file,
host=api_endpoint,
scopes=client_options.scopes,
- ssl_channel_credentials=ssl_credentials,
+ client_cert_source_for_mtls=client_cert_source_func,
quota_project_id=client_options.quota_project_id,
client_info=client_info,
)
@@ -399,16 +431,17 @@ def create_flow(
r"""Creates a flow in the specified agent.
Args:
- request (:class:`~.gcdc_flow.CreateFlowRequest`):
+ request (google.cloud.dialogflowcx_v3.types.CreateFlowRequest):
The request object. The request message for
[Flows.CreateFlow][google.cloud.dialogflow.cx.v3.Flows.CreateFlow].
- parent (:class:`str`):
+ parent (str):
Required. The agent to create a flow for. Format:
``projects//locations//agents/``.
+
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
- flow (:class:`~.gcdc_flow.Flow`):
+ flow (google.cloud.dialogflowcx_v3.types.Flow):
Required. The flow to create.
This corresponds to the ``flow`` field
on the ``request`` instance; if ``request`` is provided, this
@@ -421,7 +454,7 @@ def create_flow(
sent along with the request as metadata.
Returns:
- ~.gcdc_flow.Flow:
+ google.cloud.dialogflowcx_v3.types.Flow:
Flows represents the conversation
flows when you build your chatbot agent.
A flow consists of many pages connected
@@ -500,12 +533,13 @@ def delete_flow(
r"""Deletes a specified flow.
Args:
- request (:class:`~.flow.DeleteFlowRequest`):
+ request (google.cloud.dialogflowcx_v3.types.DeleteFlowRequest):
The request object. The request message for
[Flows.DeleteFlow][google.cloud.dialogflow.cx.v3.Flows.DeleteFlow].
- name (:class:`str`):
+ name (str):
Required. The name of the flow to delete. Format:
``projects//locations//agents//flows/``.
+
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -566,12 +600,13 @@ def list_flows(
r"""Returns the list of all flows in the specified agent.
Args:
- request (:class:`~.flow.ListFlowsRequest`):
+ request (google.cloud.dialogflowcx_v3.types.ListFlowsRequest):
The request object. The request message for
[Flows.ListFlows][google.cloud.dialogflow.cx.v3.Flows.ListFlows].
- parent (:class:`str`):
+ parent (str):
Required. The agent containing the flows. Format:
``projects//locations//agents/``.
+
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -583,7 +618,7 @@ def list_flows(
sent along with the request as metadata.
Returns:
- ~.pagers.ListFlowsPager:
+ google.cloud.dialogflowcx_v3.services.flows.pagers.ListFlowsPager:
The response message for
[Flows.ListFlows][google.cloud.dialogflow.cx.v3.Flows.ListFlows].
@@ -648,12 +683,13 @@ def get_flow(
r"""Retrieves the specified flow.
Args:
- request (:class:`~.flow.GetFlowRequest`):
+ request (google.cloud.dialogflowcx_v3.types.GetFlowRequest):
The request object. The response message for
[Flows.GetFlow][google.cloud.dialogflow.cx.v3.Flows.GetFlow].
- name (:class:`str`):
+ name (str):
Required. The name of the flow to get. Format:
``projects//locations//agents//flows/``.
+
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -665,7 +701,7 @@ def get_flow(
sent along with the request as metadata.
Returns:
- ~.flow.Flow:
+ google.cloud.dialogflowcx_v3.types.Flow:
Flows represents the conversation
flows when you build your chatbot agent.
A flow consists of many pages connected
@@ -743,18 +779,19 @@ def update_flow(
r"""Updates the specified flow.
Args:
- request (:class:`~.gcdc_flow.UpdateFlowRequest`):
+ request (google.cloud.dialogflowcx_v3.types.UpdateFlowRequest):
The request object. The request message for
[Flows.UpdateFlow][google.cloud.dialogflow.cx.v3.Flows.UpdateFlow].
- flow (:class:`~.gcdc_flow.Flow`):
+ flow (google.cloud.dialogflowcx_v3.types.Flow):
Required. The flow to update.
This corresponds to the ``flow`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
- update_mask (:class:`~.field_mask.FieldMask`):
+ update_mask (google.protobuf.field_mask_pb2.FieldMask):
Required. The mask to control which fields get updated.
If ``update_mask`` is not specified, an error will be
returned.
+
This corresponds to the ``update_mask`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -766,7 +803,7 @@ def update_flow(
sent along with the request as metadata.
Returns:
- ~.gcdc_flow.Flow:
+ google.cloud.dialogflowcx_v3.types.Flow:
Flows represents the conversation
flows when you build your chatbot agent.
A flow consists of many pages connected
@@ -848,12 +885,13 @@ def train_flow(
'draft' environment is trained.
Args:
- request (:class:`~.flow.TrainFlowRequest`):
+ request (google.cloud.dialogflowcx_v3.types.TrainFlowRequest):
The request object. The request message for
[Flows.TrainFlow][google.cloud.dialogflow.cx.v3.Flows.TrainFlow].
- name (:class:`str`):
+ name (str):
Required. The flow to train. Format:
``projects//locations//agents//flows/``.
+
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -865,24 +903,22 @@ def train_flow(
sent along with the request as metadata.
Returns:
- ~.operation.Operation:
+ google.api_core.operation.Operation:
An object representing a long-running operation.
- The result type for the operation will be
- :class:``~.empty.Empty``: A generic empty message that
- you can re-use to avoid defining duplicated empty
- messages in your APIs. A typical example is to use it as
- the request or the response type of an API method. For
- instance:
+ The result type for the operation will be :class:`google.protobuf.empty_pb2.Empty` A generic empty message that you can re-use to avoid defining duplicated
+ empty messages in your APIs. A typical example is to
+ use it as the request or the response type of an API
+ method. For instance:
- ::
+ service Foo {
+ rpc Bar(google.protobuf.Empty) returns
+ (google.protobuf.Empty);
- service Foo {
- rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
- }
+ }
- The JSON representation for ``Empty`` is empty JSON
- object ``{}``.
+ The JSON representation for Empty is empty JSON
+ object {}.
"""
# Create or coerce a protobuf request object.
@@ -932,6 +968,138 @@ def train_flow(
# Done; return the response.
return response
+ def validate_flow(
+ self,
+ request: flow.ValidateFlowRequest = None,
+ *,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> flow.FlowValidationResult:
+ r"""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.
+
+ Args:
+ request (google.cloud.dialogflowcx_v3.types.ValidateFlowRequest):
+ The request object. The request message for
+ [Flows.ValidateFlow][google.cloud.dialogflow.cx.v3.Flows.ValidateFlow].
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ google.cloud.dialogflowcx_v3.types.FlowValidationResult:
+ The response message for
+ [Flows.GetFlowValidationResult][google.cloud.dialogflow.cx.v3.Flows.GetFlowValidationResult].
+
+ """
+ # Create or coerce a protobuf request object.
+
+ # Minor optimization to avoid making a copy if the user passes
+ # in a flow.ValidateFlowRequest.
+ # There's no risk of modifying the input as we've already verified
+ # there are no flattened fields.
+ if not isinstance(request, flow.ValidateFlowRequest):
+ request = flow.ValidateFlowRequest(request)
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = self._transport._wrapped_methods[self._transport.validate_flow]
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
+ def get_flow_validation_result(
+ self,
+ request: flow.GetFlowValidationResultRequest = None,
+ *,
+ name: str = None,
+ retry: retries.Retry = gapic_v1.method.DEFAULT,
+ timeout: float = None,
+ metadata: Sequence[Tuple[str, str]] = (),
+ ) -> flow.FlowValidationResult:
+ r"""Gets the latest flow validation result. Flow
+ validation is performed when ValidateFlow is called.
+
+ Args:
+ request (google.cloud.dialogflowcx_v3.types.GetFlowValidationResultRequest):
+ The request object. The request message for
+ [Flows.GetFlowValidationResult][google.cloud.dialogflow.cx.v3.Flows.GetFlowValidationResult].
+ name (str):
+ Required. The flow name. Format:
+ ``projects//locations//agents//flows//validationResult``.
+
+ This corresponds to the ``name`` field
+ on the ``request`` instance; if ``request`` is provided, this
+ should not be set.
+
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
+ should be retried.
+ timeout (float): The timeout for this request.
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
+ sent along with the request as metadata.
+
+ Returns:
+ google.cloud.dialogflowcx_v3.types.FlowValidationResult:
+ The response message for
+ [Flows.GetFlowValidationResult][google.cloud.dialogflow.cx.v3.Flows.GetFlowValidationResult].
+
+ """
+ # Create or coerce a protobuf request object.
+ # Sanity check: If we got a request object, we should *not* have
+ # gotten any keyword arguments that map to the request.
+ has_flattened_params = any([name])
+ if request is not None and has_flattened_params:
+ raise ValueError(
+ "If the `request` argument is set, then none of "
+ "the individual field arguments should be set."
+ )
+
+ # Minor optimization to avoid making a copy if the user passes
+ # in a flow.GetFlowValidationResultRequest.
+ # There's no risk of modifying the input as we've already verified
+ # there are no flattened fields.
+ if not isinstance(request, flow.GetFlowValidationResultRequest):
+ request = flow.GetFlowValidationResultRequest(request)
+
+ # If we have keyword arguments corresponding to fields on the
+ # request, apply these.
+
+ if name is not None:
+ request.name = name
+
+ # Wrap the RPC method; this adds retry and timeout information,
+ # and friendly error handling.
+ rpc = self._transport._wrapped_methods[
+ self._transport.get_flow_validation_result
+ ]
+
+ # Certain fields should be provided within the metadata header;
+ # add these here.
+ metadata = tuple(metadata) + (
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
+ )
+
+ # Send the request.
+ response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+
+ # Done; return the response.
+ return response
+
try:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/flows/pagers.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/flows/pagers.py
index bf55d3bbfa53..9f4a90098ae7 100644
--- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/flows/pagers.py
+++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/flows/pagers.py
@@ -15,7 +15,16 @@
# limitations under the License.
#
-from typing import Any, AsyncIterable, Awaitable, Callable, Iterable, Sequence, Tuple
+from typing import (
+ Any,
+ AsyncIterable,
+ Awaitable,
+ Callable,
+ Iterable,
+ Sequence,
+ Tuple,
+ Optional,
+)
from google.cloud.dialogflowcx_v3.types import flow
@@ -24,7 +33,7 @@ class ListFlowsPager:
"""A pager for iterating through ``list_flows`` requests.
This class thinly wraps an initial
- :class:`~.flow.ListFlowsResponse` object, and
+ :class:`google.cloud.dialogflowcx_v3.types.ListFlowsResponse` object, and
provides an ``__iter__`` method to iterate through its
``flows`` field.
@@ -33,7 +42,7 @@ class ListFlowsPager:
through the ``flows`` field on the
corresponding responses.
- All the usual :class:`~.flow.ListFlowsResponse`
+ All the usual :class:`google.cloud.dialogflowcx_v3.types.ListFlowsResponse`
attributes are available on the pager. If multiple requests are made, only
the most recent response is retained, and thus used for attribute lookup.
"""
@@ -51,9 +60,9 @@ def __init__(
Args:
method (Callable): The method that was originally called, and
which instantiated this pager.
- request (:class:`~.flow.ListFlowsRequest`):
+ request (google.cloud.dialogflowcx_v3.types.ListFlowsRequest):
The initial request object.
- response (:class:`~.flow.ListFlowsResponse`):
+ response (google.cloud.dialogflowcx_v3.types.ListFlowsResponse):
The initial response object.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
@@ -86,7 +95,7 @@ class ListFlowsAsyncPager:
"""A pager for iterating through ``list_flows`` requests.
This class thinly wraps an initial
- :class:`~.flow.ListFlowsResponse` object, and
+ :class:`google.cloud.dialogflowcx_v3.types.ListFlowsResponse` object, and
provides an ``__aiter__`` method to iterate through its
``flows`` field.
@@ -95,7 +104,7 @@ class ListFlowsAsyncPager:
through the ``flows`` field on the
corresponding responses.
- All the usual :class:`~.flow.ListFlowsResponse`
+ All the usual :class:`google.cloud.dialogflowcx_v3.types.ListFlowsResponse`
attributes are available on the pager. If multiple requests are made, only
the most recent response is retained, and thus used for attribute lookup.
"""
@@ -113,9 +122,9 @@ def __init__(
Args:
method (Callable): The method that was originally called, and
which instantiated this pager.
- request (:class:`~.flow.ListFlowsRequest`):
+ request (google.cloud.dialogflowcx_v3.types.ListFlowsRequest):
The initial request object.
- response (:class:`~.flow.ListFlowsResponse`):
+ response (google.cloud.dialogflowcx_v3.types.ListFlowsResponse):
The initial response object.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/flows/transports/base.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/flows/transports/base.py
index 750a522e6e5b..9672aeb9d0f0 100644
--- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/flows/transports/base.py
+++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/flows/transports/base.py
@@ -131,6 +131,14 @@ def _prep_wrapped_messages(self, client_info):
self.train_flow: gapic_v1.method.wrap_method(
self.train_flow, default_timeout=None, client_info=client_info,
),
+ self.validate_flow: gapic_v1.method.wrap_method(
+ self.validate_flow, default_timeout=None, client_info=client_info,
+ ),
+ self.get_flow_validation_result: gapic_v1.method.wrap_method(
+ self.get_flow_validation_result,
+ default_timeout=None,
+ client_info=client_info,
+ ),
}
@property
@@ -191,5 +199,27 @@ def train_flow(
]:
raise NotImplementedError()
+ @property
+ def validate_flow(
+ self,
+ ) -> typing.Callable[
+ [flow.ValidateFlowRequest],
+ typing.Union[
+ flow.FlowValidationResult, typing.Awaitable[flow.FlowValidationResult]
+ ],
+ ]:
+ raise NotImplementedError()
+
+ @property
+ def get_flow_validation_result(
+ self,
+ ) -> typing.Callable[
+ [flow.GetFlowValidationResultRequest],
+ typing.Union[
+ flow.FlowValidationResult, typing.Awaitable[flow.FlowValidationResult]
+ ],
+ ]:
+ raise NotImplementedError()
+
__all__ = ("FlowsTransport",)
diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/flows/transports/grpc.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/flows/transports/grpc.py
index 3089c3bc5597..1c5432805af2 100644
--- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/flows/transports/grpc.py
+++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/flows/transports/grpc.py
@@ -61,6 +61,7 @@ def __init__(
api_mtls_endpoint: str = None,
client_cert_source: Callable[[], Tuple[bytes, bytes]] = None,
ssl_channel_credentials: grpc.ChannelCredentials = None,
+ client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None,
quota_project_id: Optional[str] = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
) -> None:
@@ -91,6 +92,10 @@ def __init__(
``api_mtls_endpoint`` is None.
ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials
for grpc channel. It is ignored if ``channel`` is provided.
+ client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]):
+ A callback to provide client certificate bytes and private key bytes,
+ both in PEM format. It is used to configure mutual TLS channel. It is
+ ignored if ``channel`` or ``ssl_channel_credentials`` is provided.
quota_project_id (Optional[str]): An optional project to use for billing
and quota.
client_info (google.api_core.gapic_v1.client_info.ClientInfo):
@@ -107,6 +112,11 @@ def __init__(
"""
self._ssl_channel_credentials = ssl_channel_credentials
+ if api_mtls_endpoint:
+ warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning)
+ if client_cert_source:
+ warnings.warn("client_cert_source is deprecated", DeprecationWarning)
+
if channel:
# Sanity check: Ensure that channel and credentials are not both
# provided.
@@ -116,11 +126,6 @@ def __init__(
self._grpc_channel = channel
self._ssl_channel_credentials = None
elif api_mtls_endpoint:
- warnings.warn(
- "api_mtls_endpoint and client_cert_source are deprecated",
- DeprecationWarning,
- )
-
host = (
api_mtls_endpoint
if ":" in api_mtls_endpoint
@@ -164,12 +169,18 @@ def __init__(
scopes=self.AUTH_SCOPES, quota_project_id=quota_project_id
)
+ if client_cert_source_for_mtls and not ssl_channel_credentials:
+ cert, key = client_cert_source_for_mtls()
+ self._ssl_channel_credentials = grpc.ssl_channel_credentials(
+ certificate_chain=cert, private_key=key
+ )
+
# create a new channel. The provided one is ignored.
self._grpc_channel = type(self).create_channel(
host,
credentials=credentials,
credentials_file=credentials_file,
- ssl_credentials=ssl_channel_credentials,
+ ssl_credentials=self._ssl_channel_credentials,
scopes=scopes or self.AUTH_SCOPES,
quota_project_id=quota_project_id,
options=[
@@ -401,5 +412,61 @@ def train_flow(self) -> Callable[[flow.TrainFlowRequest], operations.Operation]:
)
return self._stubs["train_flow"]
+ @property
+ def validate_flow(
+ self,
+ ) -> Callable[[flow.ValidateFlowRequest], flow.FlowValidationResult]:
+ r"""Return a callable for the validate flow method over gRPC.
+
+ 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.
+
+ Returns:
+ Callable[[~.ValidateFlowRequest],
+ ~.FlowValidationResult]:
+ A function that, when called, will call the underlying RPC
+ on the server.
+ """
+ # Generate a "stub function" on-the-fly which will actually make
+ # the request.
+ # gRPC handles serialization and deserialization, so we just need
+ # to pass in the functions for each.
+ if "validate_flow" not in self._stubs:
+ self._stubs["validate_flow"] = self.grpc_channel.unary_unary(
+ "/google.cloud.dialogflow.cx.v3.Flows/ValidateFlow",
+ request_serializer=flow.ValidateFlowRequest.serialize,
+ response_deserializer=flow.FlowValidationResult.deserialize,
+ )
+ return self._stubs["validate_flow"]
+
+ @property
+ def get_flow_validation_result(
+ self,
+ ) -> Callable[[flow.GetFlowValidationResultRequest], flow.FlowValidationResult]:
+ r"""Return a callable for the get flow validation result method over gRPC.
+
+ Gets the latest flow validation result. Flow
+ validation is performed when ValidateFlow is called.
+
+ Returns:
+ Callable[[~.GetFlowValidationResultRequest],
+ ~.FlowValidationResult]:
+ A function that, when called, will call the underlying RPC
+ on the server.
+ """
+ # Generate a "stub function" on-the-fly which will actually make
+ # the request.
+ # gRPC handles serialization and deserialization, so we just need
+ # to pass in the functions for each.
+ if "get_flow_validation_result" not in self._stubs:
+ self._stubs["get_flow_validation_result"] = self.grpc_channel.unary_unary(
+ "/google.cloud.dialogflow.cx.v3.Flows/GetFlowValidationResult",
+ request_serializer=flow.GetFlowValidationResultRequest.serialize,
+ response_deserializer=flow.FlowValidationResult.deserialize,
+ )
+ return self._stubs["get_flow_validation_result"]
+
__all__ = ("FlowsGrpcTransport",)
diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/flows/transports/grpc_asyncio.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/flows/transports/grpc_asyncio.py
index 67607e7007d9..fadbc2f11de1 100644
--- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/flows/transports/grpc_asyncio.py
+++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/flows/transports/grpc_asyncio.py
@@ -105,6 +105,7 @@ def __init__(
api_mtls_endpoint: str = None,
client_cert_source: Callable[[], Tuple[bytes, bytes]] = None,
ssl_channel_credentials: grpc.ChannelCredentials = None,
+ client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None,
quota_project_id=None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
) -> None:
@@ -136,6 +137,10 @@ def __init__(
``api_mtls_endpoint`` is None.
ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials
for grpc channel. It is ignored if ``channel`` is provided.
+ client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]):
+ A callback to provide client certificate bytes and private key bytes,
+ both in PEM format. It is used to configure mutual TLS channel. It is
+ ignored if ``channel`` or ``ssl_channel_credentials`` is provided.
quota_project_id (Optional[str]): An optional project to use for billing
and quota.
client_info (google.api_core.gapic_v1.client_info.ClientInfo):
@@ -152,6 +157,11 @@ def __init__(
"""
self._ssl_channel_credentials = ssl_channel_credentials
+ if api_mtls_endpoint:
+ warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning)
+ if client_cert_source:
+ warnings.warn("client_cert_source is deprecated", DeprecationWarning)
+
if channel:
# Sanity check: Ensure that channel and credentials are not both
# provided.
@@ -161,11 +171,6 @@ def __init__(
self._grpc_channel = channel
self._ssl_channel_credentials = None
elif api_mtls_endpoint:
- warnings.warn(
- "api_mtls_endpoint and client_cert_source are deprecated",
- DeprecationWarning,
- )
-
host = (
api_mtls_endpoint
if ":" in api_mtls_endpoint
@@ -209,12 +214,18 @@ def __init__(
scopes=self.AUTH_SCOPES, quota_project_id=quota_project_id
)
+ if client_cert_source_for_mtls and not ssl_channel_credentials:
+ cert, key = client_cert_source_for_mtls()
+ self._ssl_channel_credentials = grpc.ssl_channel_credentials(
+ certificate_chain=cert, private_key=key
+ )
+
# create a new channel. The provided one is ignored.
self._grpc_channel = type(self).create_channel(
host,
credentials=credentials,
credentials_file=credentials_file,
- ssl_credentials=ssl_channel_credentials,
+ ssl_credentials=self._ssl_channel_credentials,
scopes=scopes or self.AUTH_SCOPES,
quota_project_id=quota_project_id,
options=[
@@ -415,5 +426,63 @@ def train_flow(
)
return self._stubs["train_flow"]
+ @property
+ def validate_flow(
+ self,
+ ) -> Callable[[flow.ValidateFlowRequest], Awaitable[flow.FlowValidationResult]]:
+ r"""Return a callable for the validate flow method over gRPC.
+
+ 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.
+
+ Returns:
+ Callable[[~.ValidateFlowRequest],
+ Awaitable[~.FlowValidationResult]]:
+ A function that, when called, will call the underlying RPC
+ on the server.
+ """
+ # Generate a "stub function" on-the-fly which will actually make
+ # the request.
+ # gRPC handles serialization and deserialization, so we just need
+ # to pass in the functions for each.
+ if "validate_flow" not in self._stubs:
+ self._stubs["validate_flow"] = self.grpc_channel.unary_unary(
+ "/google.cloud.dialogflow.cx.v3.Flows/ValidateFlow",
+ request_serializer=flow.ValidateFlowRequest.serialize,
+ response_deserializer=flow.FlowValidationResult.deserialize,
+ )
+ return self._stubs["validate_flow"]
+
+ @property
+ def get_flow_validation_result(
+ self,
+ ) -> Callable[
+ [flow.GetFlowValidationResultRequest], Awaitable[flow.FlowValidationResult]
+ ]:
+ r"""Return a callable for the get flow validation result method over gRPC.
+
+ Gets the latest flow validation result. Flow
+ validation is performed when ValidateFlow is called.
+
+ Returns:
+ Callable[[~.GetFlowValidationResultRequest],
+ Awaitable[~.FlowValidationResult]]:
+ A function that, when called, will call the underlying RPC
+ on the server.
+ """
+ # Generate a "stub function" on-the-fly which will actually make
+ # the request.
+ # gRPC handles serialization and deserialization, so we just need
+ # to pass in the functions for each.
+ if "get_flow_validation_result" not in self._stubs:
+ self._stubs["get_flow_validation_result"] = self.grpc_channel.unary_unary(
+ "/google.cloud.dialogflow.cx.v3.Flows/GetFlowValidationResult",
+ request_serializer=flow.GetFlowValidationResultRequest.serialize,
+ response_deserializer=flow.FlowValidationResult.deserialize,
+ )
+ return self._stubs["get_flow_validation_result"]
+
__all__ = ("FlowsGrpcAsyncIOTransport",)
diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/intents/async_client.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/intents/async_client.py
index 04ee85cf0621..2a2d271d08d8 100644
--- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/intents/async_client.py
+++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/intents/async_client.py
@@ -74,7 +74,36 @@ class IntentsAsyncClient:
common_location_path = staticmethod(IntentsClient.common_location_path)
parse_common_location_path = staticmethod(IntentsClient.parse_common_location_path)
- from_service_account_file = IntentsClient.from_service_account_file
+ @classmethod
+ def from_service_account_info(cls, info: dict, *args, **kwargs):
+ """Creates an instance of this client using the provided credentials info.
+
+ Args:
+ info (dict): The service account private key info.
+ args: Additional arguments to pass to the constructor.
+ kwargs: Additional arguments to pass to the constructor.
+
+ Returns:
+ IntentsAsyncClient: The constructed client.
+ """
+ return IntentsClient.from_service_account_info.__func__(IntentsAsyncClient, info, *args, **kwargs) # type: ignore
+
+ @classmethod
+ def from_service_account_file(cls, filename: str, *args, **kwargs):
+ """Creates an instance of this client using the provided credentials
+ file.
+
+ Args:
+ filename (str): The path to the service account private key json
+ file.
+ args: Additional arguments to pass to the constructor.
+ kwargs: Additional arguments to pass to the constructor.
+
+ Returns:
+ IntentsAsyncClient: The constructed client.
+ """
+ return IntentsClient.from_service_account_file.__func__(IntentsAsyncClient, filename, *args, **kwargs) # type: ignore
+
from_service_account_json = from_service_account_file
@property
@@ -151,12 +180,13 @@ async def list_intents(
agent.
Args:
- request (:class:`~.intent.ListIntentsRequest`):
+ request (:class:`google.cloud.dialogflowcx_v3.types.ListIntentsRequest`):
The request object. The request message for
[Intents.ListIntents][google.cloud.dialogflow.cx.v3.Intents.ListIntents].
parent (:class:`str`):
Required. The agent to list all intents for. Format:
``projects//locations//agents/``.
+
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -168,7 +198,7 @@ async def list_intents(
sent along with the request as metadata.
Returns:
- ~.pagers.ListIntentsAsyncPager:
+ google.cloud.dialogflowcx_v3.services.intents.pagers.ListIntentsAsyncPager:
The response message for
[Intents.ListIntents][google.cloud.dialogflow.cx.v3.Intents.ListIntents].
@@ -232,12 +262,13 @@ async def get_intent(
r"""Retrieves the specified intent.
Args:
- request (:class:`~.intent.GetIntentRequest`):
+ request (:class:`google.cloud.dialogflowcx_v3.types.GetIntentRequest`):
The request object. The request message for
[Intents.GetIntent][google.cloud.dialogflow.cx.v3.Intents.GetIntent].
name (:class:`str`):
Required. The name of the intent. Format:
``projects//locations//agents//intents/``.
+
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -249,7 +280,7 @@ async def get_intent(
sent along with the request as metadata.
Returns:
- ~.intent.Intent:
+ google.cloud.dialogflowcx_v3.types.Intent:
An intent represents a user's intent
to interact with a conversational agent.
You can provide information for the
@@ -310,16 +341,17 @@ async def create_intent(
r"""Creates an intent in the specified agent.
Args:
- request (:class:`~.gcdc_intent.CreateIntentRequest`):
+ request (:class:`google.cloud.dialogflowcx_v3.types.CreateIntentRequest`):
The request object. The request message for
[Intents.CreateIntent][google.cloud.dialogflow.cx.v3.Intents.CreateIntent].
parent (:class:`str`):
Required. The agent to create an intent for. Format:
``projects//locations//agents/``.
+
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
- intent (:class:`~.gcdc_intent.Intent`):
+ intent (:class:`google.cloud.dialogflowcx_v3.types.Intent`):
Required. The intent to create.
This corresponds to the ``intent`` field
on the ``request`` instance; if ``request`` is provided, this
@@ -332,7 +364,7 @@ async def create_intent(
sent along with the request as metadata.
Returns:
- ~.gcdc_intent.Intent:
+ google.cloud.dialogflowcx_v3.types.Intent:
An intent represents a user's intent
to interact with a conversational agent.
You can provide information for the
@@ -395,18 +427,19 @@ async def update_intent(
r"""Updates the specified intent.
Args:
- request (:class:`~.gcdc_intent.UpdateIntentRequest`):
+ request (:class:`google.cloud.dialogflowcx_v3.types.UpdateIntentRequest`):
The request object. The request message for
[Intents.UpdateIntent][google.cloud.dialogflow.cx.v3.Intents.UpdateIntent].
- intent (:class:`~.gcdc_intent.Intent`):
+ intent (:class:`google.cloud.dialogflowcx_v3.types.Intent`):
Required. The intent to update.
This corresponds to the ``intent`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
- update_mask (:class:`~.field_mask.FieldMask`):
+ update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`):
The mask to control which fields get
updated. If the mask is not present, all
fields will be updated.
+
This corresponds to the ``update_mask`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -418,7 +451,7 @@ async def update_intent(
sent along with the request as metadata.
Returns:
- ~.gcdc_intent.Intent:
+ google.cloud.dialogflowcx_v3.types.Intent:
An intent represents a user's intent
to interact with a conversational agent.
You can provide information for the
@@ -482,12 +515,13 @@ async def delete_intent(
r"""Deletes the specified intent.
Args:
- request (:class:`~.intent.DeleteIntentRequest`):
+ request (:class:`google.cloud.dialogflowcx_v3.types.DeleteIntentRequest`):
The request object. The request message for
[Intents.DeleteIntent][google.cloud.dialogflow.cx.v3.Intents.DeleteIntent].
name (:class:`str`):
Required. The name of the intent to delete. Format:
``projects//locations//agents//intents/``.
+
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/intents/client.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/intents/client.py
index 63d5ef524d73..9a4e0a2b73fc 100644
--- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/intents/client.py
+++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/intents/client.py
@@ -112,6 +112,22 @@ def _get_default_mtls_endpoint(api_endpoint):
DEFAULT_ENDPOINT
)
+ @classmethod
+ def from_service_account_info(cls, info: dict, *args, **kwargs):
+ """Creates an instance of this client using the provided credentials info.
+
+ Args:
+ info (dict): The service account private key info.
+ args: Additional arguments to pass to the constructor.
+ kwargs: Additional arguments to pass to the constructor.
+
+ Returns:
+ IntentsClient: The constructed client.
+ """
+ credentials = service_account.Credentials.from_service_account_info(info)
+ kwargs["credentials"] = credentials
+ return cls(*args, **kwargs)
+
@classmethod
def from_service_account_file(cls, filename: str, *args, **kwargs):
"""Creates an instance of this client using the provided credentials
@@ -124,7 +140,7 @@ def from_service_account_file(cls, filename: str, *args, **kwargs):
kwargs: Additional arguments to pass to the constructor.
Returns:
- {@api.name}: The constructed client.
+ IntentsClient: The constructed client.
"""
credentials = service_account.Credentials.from_service_account_file(filename)
kwargs["credentials"] = credentials
@@ -250,10 +266,10 @@ def __init__(
credentials identify the application to the service; if none
are specified, the client will attempt to ascertain the
credentials from the environment.
- transport (Union[str, ~.IntentsTransport]): The
+ transport (Union[str, IntentsTransport]): The
transport to use. If set to None, a transport is chosen
automatically.
- client_options (client_options_lib.ClientOptions): Custom options for the
+ client_options (google.api_core.client_options.ClientOptions): Custom options for the
client. It won't take effect if a ``transport`` instance is provided.
(1) The ``api_endpoint`` property can be used to override the
default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT
@@ -289,21 +305,17 @@ def __init__(
util.strtobool(os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false"))
)
- ssl_credentials = None
+ client_cert_source_func = None
is_mtls = False
if use_client_cert:
if client_options.client_cert_source:
- import grpc # type: ignore
-
- cert, key = client_options.client_cert_source()
- ssl_credentials = grpc.ssl_channel_credentials(
- certificate_chain=cert, private_key=key
- )
is_mtls = True
+ client_cert_source_func = client_options.client_cert_source
else:
- creds = SslCredentials()
- is_mtls = creds.is_mtls
- ssl_credentials = creds.ssl_credentials if is_mtls else None
+ is_mtls = mtls.has_default_client_cert_source()
+ client_cert_source_func = (
+ mtls.default_client_cert_source() if is_mtls else None
+ )
# Figure out which api endpoint to use.
if client_options.api_endpoint is not None:
@@ -346,7 +358,7 @@ def __init__(
credentials_file=client_options.credentials_file,
host=api_endpoint,
scopes=client_options.scopes,
- ssl_channel_credentials=ssl_credentials,
+ client_cert_source_for_mtls=client_cert_source_func,
quota_project_id=client_options.quota_project_id,
client_info=client_info,
)
@@ -364,12 +376,13 @@ def list_intents(
agent.
Args:
- request (:class:`~.intent.ListIntentsRequest`):
+ request (google.cloud.dialogflowcx_v3.types.ListIntentsRequest):
The request object. The request message for
[Intents.ListIntents][google.cloud.dialogflow.cx.v3.Intents.ListIntents].
- parent (:class:`str`):
+ parent (str):
Required. The agent to list all intents for. Format:
``projects//locations//agents/``.
+
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -381,7 +394,7 @@ def list_intents(
sent along with the request as metadata.
Returns:
- ~.pagers.ListIntentsPager:
+ google.cloud.dialogflowcx_v3.services.intents.pagers.ListIntentsPager:
The response message for
[Intents.ListIntents][google.cloud.dialogflow.cx.v3.Intents.ListIntents].
@@ -446,12 +459,13 @@ def get_intent(
r"""Retrieves the specified intent.
Args:
- request (:class:`~.intent.GetIntentRequest`):
+ request (google.cloud.dialogflowcx_v3.types.GetIntentRequest):
The request object. The request message for
[Intents.GetIntent][google.cloud.dialogflow.cx.v3.Intents.GetIntent].
- name (:class:`str`):
+ name (str):
Required. The name of the intent. Format:
``projects//locations//agents//intents/``.
+
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -463,7 +477,7 @@ def get_intent(
sent along with the request as metadata.
Returns:
- ~.intent.Intent:
+ google.cloud.dialogflowcx_v3.types.Intent:
An intent represents a user's intent
to interact with a conversational agent.
You can provide information for the
@@ -525,16 +539,17 @@ def create_intent(
r"""Creates an intent in the specified agent.
Args:
- request (:class:`~.gcdc_intent.CreateIntentRequest`):
+ request (google.cloud.dialogflowcx_v3.types.CreateIntentRequest):
The request object. The request message for
[Intents.CreateIntent][google.cloud.dialogflow.cx.v3.Intents.CreateIntent].
- parent (:class:`str`):
+ parent (str):
Required. The agent to create an intent for. Format:
``projects//locations//agents/``.
+
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
- intent (:class:`~.gcdc_intent.Intent`):
+ intent (google.cloud.dialogflowcx_v3.types.Intent):
Required. The intent to create.
This corresponds to the ``intent`` field
on the ``request`` instance; if ``request`` is provided, this
@@ -547,7 +562,7 @@ def create_intent(
sent along with the request as metadata.
Returns:
- ~.gcdc_intent.Intent:
+ google.cloud.dialogflowcx_v3.types.Intent:
An intent represents a user's intent
to interact with a conversational agent.
You can provide information for the
@@ -611,18 +626,19 @@ def update_intent(
r"""Updates the specified intent.
Args:
- request (:class:`~.gcdc_intent.UpdateIntentRequest`):
+ request (google.cloud.dialogflowcx_v3.types.UpdateIntentRequest):
The request object. The request message for
[Intents.UpdateIntent][google.cloud.dialogflow.cx.v3.Intents.UpdateIntent].
- intent (:class:`~.gcdc_intent.Intent`):
+ intent (google.cloud.dialogflowcx_v3.types.Intent):
Required. The intent to update.
This corresponds to the ``intent`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
- update_mask (:class:`~.field_mask.FieldMask`):
+ update_mask (google.protobuf.field_mask_pb2.FieldMask):
The mask to control which fields get
updated. If the mask is not present, all
fields will be updated.
+
This corresponds to the ``update_mask`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -634,7 +650,7 @@ def update_intent(
sent along with the request as metadata.
Returns:
- ~.gcdc_intent.Intent:
+ google.cloud.dialogflowcx_v3.types.Intent:
An intent represents a user's intent
to interact with a conversational agent.
You can provide information for the
@@ -699,12 +715,13 @@ def delete_intent(
r"""Deletes the specified intent.
Args:
- request (:class:`~.intent.DeleteIntentRequest`):
+ request (google.cloud.dialogflowcx_v3.types.DeleteIntentRequest):
The request object. The request message for
[Intents.DeleteIntent][google.cloud.dialogflow.cx.v3.Intents.DeleteIntent].
- name (:class:`str`):
+ name (str):
Required. The name of the intent to delete. Format:
``projects//locations//agents//intents/``.
+
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/intents/pagers.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/intents/pagers.py
index 1e3f29ddcb52..c7bd659152d9 100644
--- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/intents/pagers.py
+++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/intents/pagers.py
@@ -15,7 +15,16 @@
# limitations under the License.
#
-from typing import Any, AsyncIterable, Awaitable, Callable, Iterable, Sequence, Tuple
+from typing import (
+ Any,
+ AsyncIterable,
+ Awaitable,
+ Callable,
+ Iterable,
+ Sequence,
+ Tuple,
+ Optional,
+)
from google.cloud.dialogflowcx_v3.types import intent
@@ -24,7 +33,7 @@ class ListIntentsPager:
"""A pager for iterating through ``list_intents`` requests.
This class thinly wraps an initial
- :class:`~.intent.ListIntentsResponse` object, and
+ :class:`google.cloud.dialogflowcx_v3.types.ListIntentsResponse` object, and
provides an ``__iter__`` method to iterate through its
``intents`` field.
@@ -33,7 +42,7 @@ class ListIntentsPager:
through the ``intents`` field on the
corresponding responses.
- All the usual :class:`~.intent.ListIntentsResponse`
+ All the usual :class:`google.cloud.dialogflowcx_v3.types.ListIntentsResponse`
attributes are available on the pager. If multiple requests are made, only
the most recent response is retained, and thus used for attribute lookup.
"""
@@ -51,9 +60,9 @@ def __init__(
Args:
method (Callable): The method that was originally called, and
which instantiated this pager.
- request (:class:`~.intent.ListIntentsRequest`):
+ request (google.cloud.dialogflowcx_v3.types.ListIntentsRequest):
The initial request object.
- response (:class:`~.intent.ListIntentsResponse`):
+ response (google.cloud.dialogflowcx_v3.types.ListIntentsResponse):
The initial response object.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
@@ -86,7 +95,7 @@ class ListIntentsAsyncPager:
"""A pager for iterating through ``list_intents`` requests.
This class thinly wraps an initial
- :class:`~.intent.ListIntentsResponse` object, and
+ :class:`google.cloud.dialogflowcx_v3.types.ListIntentsResponse` object, and
provides an ``__aiter__`` method to iterate through its
``intents`` field.
@@ -95,7 +104,7 @@ class ListIntentsAsyncPager:
through the ``intents`` field on the
corresponding responses.
- All the usual :class:`~.intent.ListIntentsResponse`
+ All the usual :class:`google.cloud.dialogflowcx_v3.types.ListIntentsResponse`
attributes are available on the pager. If multiple requests are made, only
the most recent response is retained, and thus used for attribute lookup.
"""
@@ -113,9 +122,9 @@ def __init__(
Args:
method (Callable): The method that was originally called, and
which instantiated this pager.
- request (:class:`~.intent.ListIntentsRequest`):
+ request (google.cloud.dialogflowcx_v3.types.ListIntentsRequest):
The initial request object.
- response (:class:`~.intent.ListIntentsResponse`):
+ response (google.cloud.dialogflowcx_v3.types.ListIntentsResponse):
The initial response object.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/intents/transports/grpc.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/intents/transports/grpc.py
index a5f67339ff12..db8768dac96e 100644
--- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/intents/transports/grpc.py
+++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/intents/transports/grpc.py
@@ -60,6 +60,7 @@ def __init__(
api_mtls_endpoint: str = None,
client_cert_source: Callable[[], Tuple[bytes, bytes]] = None,
ssl_channel_credentials: grpc.ChannelCredentials = None,
+ client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None,
quota_project_id: Optional[str] = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
) -> None:
@@ -90,6 +91,10 @@ def __init__(
``api_mtls_endpoint`` is None.
ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials
for grpc channel. It is ignored if ``channel`` is provided.
+ client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]):
+ A callback to provide client certificate bytes and private key bytes,
+ both in PEM format. It is used to configure mutual TLS channel. It is
+ ignored if ``channel`` or ``ssl_channel_credentials`` is provided.
quota_project_id (Optional[str]): An optional project to use for billing
and quota.
client_info (google.api_core.gapic_v1.client_info.ClientInfo):
@@ -106,6 +111,11 @@ def __init__(
"""
self._ssl_channel_credentials = ssl_channel_credentials
+ if api_mtls_endpoint:
+ warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning)
+ if client_cert_source:
+ warnings.warn("client_cert_source is deprecated", DeprecationWarning)
+
if channel:
# Sanity check: Ensure that channel and credentials are not both
# provided.
@@ -115,11 +125,6 @@ def __init__(
self._grpc_channel = channel
self._ssl_channel_credentials = None
elif api_mtls_endpoint:
- warnings.warn(
- "api_mtls_endpoint and client_cert_source are deprecated",
- DeprecationWarning,
- )
-
host = (
api_mtls_endpoint
if ":" in api_mtls_endpoint
@@ -163,12 +168,18 @@ def __init__(
scopes=self.AUTH_SCOPES, quota_project_id=quota_project_id
)
+ if client_cert_source_for_mtls and not ssl_channel_credentials:
+ cert, key = client_cert_source_for_mtls()
+ self._ssl_channel_credentials = grpc.ssl_channel_credentials(
+ certificate_chain=cert, private_key=key
+ )
+
# create a new channel. The provided one is ignored.
self._grpc_channel = type(self).create_channel(
host,
credentials=credentials,
credentials_file=credentials_file,
- ssl_credentials=ssl_channel_credentials,
+ ssl_credentials=self._ssl_channel_credentials,
scopes=scopes or self.AUTH_SCOPES,
quota_project_id=quota_project_id,
options=[
diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/intents/transports/grpc_asyncio.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/intents/transports/grpc_asyncio.py
index 8511e4eb5d7b..f66c9c4ea390 100644
--- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/intents/transports/grpc_asyncio.py
+++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/intents/transports/grpc_asyncio.py
@@ -104,6 +104,7 @@ def __init__(
api_mtls_endpoint: str = None,
client_cert_source: Callable[[], Tuple[bytes, bytes]] = None,
ssl_channel_credentials: grpc.ChannelCredentials = None,
+ client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None,
quota_project_id=None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
) -> None:
@@ -135,6 +136,10 @@ def __init__(
``api_mtls_endpoint`` is None.
ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials
for grpc channel. It is ignored if ``channel`` is provided.
+ client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]):
+ A callback to provide client certificate bytes and private key bytes,
+ both in PEM format. It is used to configure mutual TLS channel. It is
+ ignored if ``channel`` or ``ssl_channel_credentials`` is provided.
quota_project_id (Optional[str]): An optional project to use for billing
and quota.
client_info (google.api_core.gapic_v1.client_info.ClientInfo):
@@ -151,6 +156,11 @@ def __init__(
"""
self._ssl_channel_credentials = ssl_channel_credentials
+ if api_mtls_endpoint:
+ warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning)
+ if client_cert_source:
+ warnings.warn("client_cert_source is deprecated", DeprecationWarning)
+
if channel:
# Sanity check: Ensure that channel and credentials are not both
# provided.
@@ -160,11 +170,6 @@ def __init__(
self._grpc_channel = channel
self._ssl_channel_credentials = None
elif api_mtls_endpoint:
- warnings.warn(
- "api_mtls_endpoint and client_cert_source are deprecated",
- DeprecationWarning,
- )
-
host = (
api_mtls_endpoint
if ":" in api_mtls_endpoint
@@ -208,12 +213,18 @@ def __init__(
scopes=self.AUTH_SCOPES, quota_project_id=quota_project_id
)
+ if client_cert_source_for_mtls and not ssl_channel_credentials:
+ cert, key = client_cert_source_for_mtls()
+ self._ssl_channel_credentials = grpc.ssl_channel_credentials(
+ certificate_chain=cert, private_key=key
+ )
+
# create a new channel. The provided one is ignored.
self._grpc_channel = type(self).create_channel(
host,
credentials=credentials,
credentials_file=credentials_file,
- ssl_credentials=ssl_channel_credentials,
+ ssl_credentials=self._ssl_channel_credentials,
scopes=scopes or self.AUTH_SCOPES,
quota_project_id=quota_project_id,
options=[
diff --git a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/pages/async_client.py b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/pages/async_client.py
index 3a900c6fce0c..eb761cffb1cf 100644
--- a/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/pages/async_client.py
+++ b/packages/google-cloud-dialogflow-cx/google/cloud/dialogflowcx_v3/services/pages/async_client.py
@@ -81,7 +81,36 @@ class PagesAsyncClient:
common_location_path = staticmethod(PagesClient.common_location_path)
parse_common_location_path = staticmethod(PagesClient.parse_common_location_path)
- from_service_account_file = PagesClient.from_service_account_file
+ @classmethod
+ def from_service_account_info(cls, info: dict, *args, **kwargs):
+ """Creates an instance of this client using the provided credentials info.
+
+ Args:
+ info (dict): The service account private key info.
+ args: Additional arguments to pass to the constructor.
+ kwargs: Additional arguments to pass to the constructor.
+
+ Returns:
+ PagesAsyncClient: The constructed client.
+ """
+ return PagesClient.from_service_account_info.__func__(PagesAsyncClient, info, *args, **kwargs) # type: ignore
+
+ @classmethod
+ def from_service_account_file(cls, filename: str, *args, **kwargs):
+ """Creates an instance of this client using the provided credentials
+ file.
+
+ Args:
+ filename (str): The path to the service account private key json
+ file.
+ args: Additional arguments to pass to the constructor.
+ kwargs: Additional arguments to pass to the constructor.
+
+ Returns:
+ PagesAsyncClient: The constructed client.
+ """
+ return PagesClient.from_service_account_file.__func__(PagesAsyncClient, filename, *args, **kwargs) # type: ignore
+
from_service_account_json = from_service_account_file
@property
@@ -157,12 +186,13 @@ async def list_pages(
r"""Returns the list of all pages in the specified flow.
Args:
- request (:class:`~.page.ListPagesRequest`):
+ request (:class:`google.cloud.dialogflowcx_v3.types.ListPagesRequest`):
The request object. The request message for
[Pages.ListPages][google.cloud.dialogflow.cx.v3.Pages.ListPages].
parent (:class:`str`):
Required. The flow to list all pages for. Format:
``projects//locations//agents//flows/``.
+
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
@@ -174,7 +204,7 @@ async def list_pages(
sent along with the request as metadata.
Returns:
- ~.pagers.ListPagesAsyncPager:
+ google.cloud.dialogflowcx_v3.services.pages.pagers.ListPagesAsyncPager:
The response message for
[Pages.ListPages][google.cloud.dialogflow.cx.v3.Pages.ListPages].
@@ -238,12 +268,13 @@ async def get_page(
r"""Retrieves the specified page.
Args:
- request (:class:`~.page.GetPageRequest`):
+ request (:class:`google.cloud.dialogflowcx_v3.types.GetPageRequest`):
The request object. The request message for
[Pages.GetPage][google.cloud.dialogflow.cx.v3.Pages.GetPage].
name (:class:`str`):
Required. The name of the page. Format:
``projects/