Skip to content

Commit

Permalink
chore: re-generate (#41)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
yoshi-automation authored Mar 5, 2021
1 parent 83969a0 commit a026a52
Show file tree
Hide file tree
Showing 264 changed files with 34,158 additions and 6,311 deletions.
18 changes: 18 additions & 0 deletions packages/google-cloud-dialogflow-cx/.coveragerc
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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"
]
}
4 changes: 3 additions & 1 deletion packages/google-cloud-dialogflow-cx/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 20 additions & 6 deletions packages/google-cloud-dialogflow-cx/.kokoro/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
1 change: 1 addition & 0 deletions packages/google-cloud-dialogflow-cx/.trampolinerc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ required_envvars+=(
pass_down_envvars+=(
"STAGING_BUCKET"
"V2_STAGING_BUCKET"
"NOX_SESSION"
)

# Prevent unintentional override on the default image.
Expand Down
22 changes: 18 additions & 4 deletions packages/google-cloud-dialogflow-cx/CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,14 @@ We use `nox <https://nox.readthedocs.io/en/latest/>`__ 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 <name of test>

.. note::

The unit tests and system tests are described in the
Expand All @@ -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::

Expand Down Expand Up @@ -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 <name of test>


.. 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
Expand Down
7 changes: 4 additions & 3 deletions packages/google-cloud-dialogflow-cx/LICENSE
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions packages/google-cloud-dialogflow-cx/MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
prune scripts/readme-gen
45 changes: 6 additions & 39 deletions packages/google-cloud-dialogflow-cx/README.rst
Original file line number Diff line number Diff line change
@@ -1,36 +1,18 @@
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
-----------

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
Expand All @@ -52,31 +34,16 @@ Mac/Linux

.. code-block:: console
pip install virtualenv
virtualenv <your-env>
python3 -m venv <your-env>
source <your-env>/bin/activate
<your-env>/bin/pip install google-cloud-dialogflow-cx
<your-env>/bin/pip install /path/to/library
Windows
^^^^^^^

.. code-block:: console
pip install virtualenv
virtualenv <your-env>
python3 -m venv <your-env>
<your-env>\Scripts\activate
<your-env>\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
<your-env>\Scripts\pip.exe install \path\to\library
7 changes: 6 additions & 1 deletion packages/google-cloud-dialogflow-cx/docs/_static/custom.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
div#python2-eol {
border-color: red;
border-width: medium;
}
}

/* Ensure minimum width for 'Parameters' / 'Returns' column */
dl.field-list > dt {
min-width: 100px
}
Original file line number Diff line number Diff line change
@@ -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:
Original file line number Diff line number Diff line change
@@ -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:
Original file line number Diff line number Diff line change
@@ -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:
Original file line number Diff line number Diff line change
@@ -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:
11 changes: 11 additions & 0 deletions packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/flows.rst
Original file line number Diff line number Diff line change
@@ -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:
Original file line number Diff line number Diff line change
@@ -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:
11 changes: 11 additions & 0 deletions packages/google-cloud-dialogflow-cx/docs/dialogflowcx_v3/pages.rst
Original file line number Diff line number Diff line change
@@ -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:
Original file line number Diff line number Diff line change
@@ -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:
Loading

0 comments on commit a026a52

Please sign in to comment.