Skip to content
This repository was archived by the owner on Jan 6, 2024. It is now read-only.

Commit d9bd192

Browse files
chore: re-generate (#41)
feat: allow to disable webhook invocation per request feat: added support for test cases and agent validation feat: supports SentimentAnalysisResult in webhook request feat: add from_service_account_info factory feat: Add new Experiment service docs: test cases doc update docs: update languages link
1 parent f7551f7 commit d9bd192

File tree

264 files changed

+34158
-6311
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

264 files changed

+34158
-6311
lines changed

.coveragerc

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[run]
2+
branch = True
3+
4+
[report]
5+
fail_under = 100
6+
show_missing = True
7+
omit =
8+
google/cloud/dialogflowcx/__init__.py
9+
exclude_lines =
10+
# Re-enable the standard pragma
11+
pragma: NO COVER
12+
# Ignore debug-only repr
13+
def __repr__
14+
# Ignore pkg_resources exceptions.
15+
# This is added at the module level as a safeguard for if someone
16+
# generates the code and tries to run it without pip installing. This
17+
# makes it virtually impossible to test properly.
18+
except pkg_resources.DistributionNotFound

.github/header-checker-lint.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{"allowedCopyrightHolders": ["Google LLC"],
2+
"allowedLicenses": ["Apache-2.0", "MIT", "BSD-3"],
3+
"ignoreFiles": ["**/requirements.txt", "**/requirements-test.txt"],
4+
"sourceFileExtensions": [
5+
"ts",
6+
"js",
7+
"java",
8+
"sh",
9+
"Dockerfile",
10+
"yaml",
11+
"py",
12+
"html",
13+
"txt"
14+
]
15+
}

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@ docs.metadata
5050

5151
# Virtual environment
5252
env/
53+
54+
# Test logs
5355
coverage.xml
54-
sponge_log.xml
56+
*sponge_log.xml
5557

5658
# System test environment variables.
5759
system_tests/local_test_setup

.kokoro/build.sh

+20-6
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@
1515

1616
set -eo pipefail
1717

18-
cd github/python-dialogflow-cx
18+
if [[ -z "${PROJECT_ROOT:-}" ]]; then
19+
PROJECT_ROOT="github/python-dialogflow-cx"
20+
fi
21+
22+
cd "${PROJECT_ROOT}"
1923

2024
# Disable buffering, so that the logs stream through.
2125
export PYTHONUNBUFFERED=1
@@ -30,16 +34,26 @@ export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/service-account.json
3034
export PROJECT_ID=$(cat "${KOKORO_GFILE_DIR}/project-id.json")
3135

3236
# Remove old nox
33-
python3.6 -m pip uninstall --yes --quiet nox-automation
37+
python3 -m pip uninstall --yes --quiet nox-automation
3438

3539
# Install nox
36-
python3.6 -m pip install --upgrade --quiet nox
37-
python3.6 -m nox --version
40+
python3 -m pip install --upgrade --quiet nox
41+
python3 -m nox --version
42+
43+
# If this is a continuous build, send the test log to the FlakyBot.
44+
# See https://github.com/googleapis/repo-automation-bots/tree/master/packages/flakybot.
45+
if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"continuous"* ]]; then
46+
cleanup() {
47+
chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot
48+
$KOKORO_GFILE_DIR/linux_amd64/flakybot
49+
}
50+
trap cleanup EXIT HUP
51+
fi
3852

3953
# If NOX_SESSION is set, it only runs the specified session,
4054
# otherwise run all the sessions.
4155
if [[ -n "${NOX_SESSION:-}" ]]; then
42-
python3.6 -m nox -s "${NOX_SESSION:-}"
56+
python3 -m nox -s ${NOX_SESSION:-}
4357
else
44-
python3.6 -m nox
58+
python3 -m nox
4559
fi

.kokoro/docs/docs-presubmit.cfg

+11
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,14 @@ env_vars: {
1515
key: "TRAMPOLINE_IMAGE_UPLOAD"
1616
value: "false"
1717
}
18+
19+
env_vars: {
20+
key: "TRAMPOLINE_BUILD_FILE"
21+
value: "github/python-dialogflow-cx/.kokoro/build.sh"
22+
}
23+
24+
# Only run this nox session.
25+
env_vars: {
26+
key: "NOX_SESSION"
27+
value: "docs docfx"
28+
}

.trampolinerc

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ required_envvars+=(
2424
pass_down_envvars+=(
2525
"STAGING_BUCKET"
2626
"V2_STAGING_BUCKET"
27+
"NOX_SESSION"
2728
)
2829

2930
# Prevent unintentional override on the default image.

CONTRIBUTING.rst

+18-4
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,14 @@ We use `nox <https://nox.readthedocs.io/en/latest/>`__ to instrument our tests.
7070
- To test your changes, run unit tests with ``nox``::
7171

7272
$ nox -s unit-2.7
73-
$ nox -s unit-3.7
73+
$ nox -s unit-3.8
7474
$ ...
7575

76+
- Args to pytest can be passed through the nox command separated by a `--`. For
77+
example, to run a single test::
78+
79+
$ nox -s unit-3.8 -- -k <name of test>
80+
7681
.. note::
7782

7883
The unit tests and system tests are described in the
@@ -93,8 +98,12 @@ On Debian/Ubuntu::
9398
************
9499
Coding Style
95100
************
101+
- We use the automatic code formatter ``black``. You can run it using
102+
the nox session ``blacken``. This will eliminate many lint errors. Run via::
103+
104+
$ nox -s blacken
96105

97-
- PEP8 compliance, with exceptions defined in the linter configuration.
106+
- PEP8 compliance is required, with exceptions defined in the linter configuration.
98107
If you have ``nox`` installed, you can test that you have not introduced
99108
any non-compliant code via::
100109

@@ -133,13 +142,18 @@ Running System Tests
133142

134143
- To run system tests, you can execute::
135144

136-
$ nox -s system-3.7
145+
# Run all system tests
146+
$ nox -s system-3.8
137147
$ nox -s system-2.7
138148

149+
# Run a single system test
150+
$ nox -s system-3.8 -- -k <name of test>
151+
152+
139153
.. note::
140154

141155
System tests are only configured to run under Python 2.7 and
142-
Python 3.7. For expediency, we do not run them in older versions
156+
Python 3.8. For expediency, we do not run them in older versions
143157
of Python 3.
144158

145159
This alone will not run the tests. You'll need to change some local

LICENSE

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
Apache License
1+
2+
Apache License
23
Version 2.0, January 2004
3-
https://www.apache.org/licenses/
4+
http://www.apache.org/licenses/
45

56
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
67

@@ -192,7 +193,7 @@
192193
you may not use this file except in compliance with the License.
193194
You may obtain a copy of the License at
194195

195-
https://www.apache.org/licenses/LICENSE-2.0
196+
http://www.apache.org/licenses/LICENSE-2.0
196197

197198
Unless required by applicable law or agreed to in writing, software
198199
distributed under the License is distributed on an "AS IS" BASIS,

MANIFEST.in

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616

1717
# Generated by synthtool. DO NOT EDIT!
1818
include README.rst LICENSE
19-
recursive-include google *.json *.proto
19+
recursive-include google *.json *.proto py.typed
2020
recursive-include tests *
2121
global-exclude *.py[co]
2222
global-exclude __pycache__
2323

2424
# Exclude scripts for samples readmegen
25-
prune scripts/readme-gen
25+
prune scripts/readme-gen

README.rst

+6-39
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,18 @@
1-
Python Client for Dialogflow CX API
1+
Python Client for Google Cloud Dialogflowcx API
22
=================================================
33

4-
|beta| |pypi| |versions|
5-
6-
`Dialogflow CX API`_: Builds conversational interfaces (for example, chatbots, and voice-powered apps and devices).
7-
8-
- `Client Library Documentation`_
9-
- `Product Documentation`_
10-
11-
.. |beta| image:: https://img.shields.io/badge/support-beta-orange.svg
12-
:target: https://github.com/googleapis/google-cloud-python/blob/master/README.rst#beta-support
13-
.. |pypi| image:: https://img.shields.io/pypi/v/google-cloud-dialogflow-cx.svg
14-
:target: https://pypi.org/project/google-cloud-dialogflow-cx/
15-
.. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-dialogflow-cx.svg
16-
:target: https://pypi.org/project/google-cloud-dialogflow-cx/
17-
.. _Dialogflow CX API: https://cloud.google.com/dialogflow/cx/docs
18-
.. _Client Library Documentation: https://googleapis.dev/python/dialogflow-cx/latest
19-
.. _Product Documentation: https://cloud.google.com/dialogflow/cx/docs
20-
214
Quick Start
225
-----------
236

247
In order to use this library, you first need to go through the following steps:
258

269
1. `Select or create a Cloud Platform project.`_
2710
2. `Enable billing for your project.`_
28-
3. `Enable the Dialogflow CX API.`_
11+
3. Enable the Google Cloud Dialogflowcx API.
2912
4. `Setup Authentication.`_
3013

3114
.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project
3215
.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project
33-
.. _Enable the Dialogflow CX API.: https://cloud.google.com/dialogflow/cx/docs
3416
.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html
3517

3618
Installation
@@ -52,31 +34,16 @@ Mac/Linux
5234

5335
.. code-block:: console
5436
55-
pip install virtualenv
56-
virtualenv <your-env>
37+
python3 -m venv <your-env>
5738
source <your-env>/bin/activate
58-
<your-env>/bin/pip install google-cloud-dialogflow-cx
39+
<your-env>/bin/pip install /path/to/library
5940
6041
6142
Windows
6243
^^^^^^^
6344

6445
.. code-block:: console
6546
66-
pip install virtualenv
67-
virtualenv <your-env>
47+
python3 -m venv <your-env>
6848
<your-env>\Scripts\activate
69-
<your-env>\Scripts\pip.exe install google-cloud-dialogflow-cx
70-
71-
Next Steps
72-
~~~~~~~~~~
73-
74-
- Read the `Client Library Documentation`_ for Cloud Dialogflow CX API
75-
API to see other available methods on the client.
76-
- Read the `Dialogflow CX API Product documentation`_ to learn
77-
more about the product and see How-to Guides.
78-
- View this `README`_ to see the full list of Cloud
79-
APIs that we cover.
80-
81-
.. _Dialogflow CX API Product documentation: https://cloud.google.com/dialogflow/cx/docs
82-
.. _README: https://github.com/googleapis/google-cloud-python/blob/master/README.rst
49+
<your-env>\Scripts\pip.exe install \path\to\library

docs/_static/custom.css

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
div#python2-eol {
22
border-color: red;
33
border-width: medium;
4-
}
4+
}
5+
6+
/* Ensure minimum width for 'Parameters' / 'Returns' column */
7+
dl.field-list > dt {
8+
min-width: 100px
9+
}

docs/dialogflowcx_v3/agents.rst

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Agents
2+
------------------------
3+
4+
.. automodule:: google.cloud.dialogflowcx_v3.services.agents
5+
:members:
6+
:inherited-members:
7+
8+
9+
.. automodule:: google.cloud.dialogflowcx_v3.services.agents.pagers
10+
:members:
11+
:inherited-members:

docs/dialogflowcx_v3/entity_types.rst

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
EntityTypes
2+
-----------------------------
3+
4+
.. automodule:: google.cloud.dialogflowcx_v3.services.entity_types
5+
:members:
6+
:inherited-members:
7+
8+
9+
.. automodule:: google.cloud.dialogflowcx_v3.services.entity_types.pagers
10+
:members:
11+
:inherited-members:

docs/dialogflowcx_v3/environments.rst

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Environments
2+
------------------------------
3+
4+
.. automodule:: google.cloud.dialogflowcx_v3.services.environments
5+
:members:
6+
:inherited-members:
7+
8+
9+
.. automodule:: google.cloud.dialogflowcx_v3.services.environments.pagers
10+
:members:
11+
:inherited-members:

docs/dialogflowcx_v3/experiments.rst

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Experiments
2+
-----------------------------
3+
4+
.. automodule:: google.cloud.dialogflowcx_v3.services.experiments
5+
:members:
6+
:inherited-members:
7+
8+
9+
.. automodule:: google.cloud.dialogflowcx_v3.services.experiments.pagers
10+
:members:
11+
:inherited-members:

docs/dialogflowcx_v3/flows.rst

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Flows
2+
-----------------------
3+
4+
.. automodule:: google.cloud.dialogflowcx_v3.services.flows
5+
:members:
6+
:inherited-members:
7+
8+
9+
.. automodule:: google.cloud.dialogflowcx_v3.services.flows.pagers
10+
:members:
11+
:inherited-members:

docs/dialogflowcx_v3/intents.rst

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Intents
2+
-------------------------
3+
4+
.. automodule:: google.cloud.dialogflowcx_v3.services.intents
5+
:members:
6+
:inherited-members:
7+
8+
9+
.. automodule:: google.cloud.dialogflowcx_v3.services.intents.pagers
10+
:members:
11+
:inherited-members:

docs/dialogflowcx_v3/pages.rst

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Pages
2+
-----------------------
3+
4+
.. automodule:: google.cloud.dialogflowcx_v3.services.pages
5+
:members:
6+
:inherited-members:
7+
8+
9+
.. automodule:: google.cloud.dialogflowcx_v3.services.pages.pagers
10+
:members:
11+
:inherited-members:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
SecuritySettingsService
2+
-----------------------------------------
3+
4+
.. automodule:: google.cloud.dialogflowcx_v3.services.security_settings_service
5+
:members:
6+
:inherited-members:
7+
8+
9+
.. automodule:: google.cloud.dialogflowcx_v3.services.security_settings_service.pagers
10+
:members:
11+
:inherited-members:

0 commit comments

Comments
 (0)