Skip to content
This repository has been archived by the owner on Dec 17, 2023. It is now read-only.

Commit

Permalink
[CHANGE ME] Re-generated to pick up changes in the API or client libr…
Browse files Browse the repository at this point in the history
…ary generator.
  • Loading branch information
yoshi-automation committed Mar 10, 2020
1 parent 713846b commit f59ddd2
Show file tree
Hide file tree
Showing 32 changed files with 1,203 additions and 715 deletions.
11 changes: 7 additions & 4 deletions .github/ISSUE_TEMPLATE/bug_report.md
Expand Up @@ -11,19 +11,22 @@ Thanks for stopping by to let us know something could be better!
Please run down the following list and make sure you've tried the usual "quick fixes":

- Search the issues already opened: https://github.com/googleapis/dialogflow-python-client-v2/issues
- Check for answers on StackOverflow: http://stackoverflow.com/questions/
- Search the issues on our "catch-all" repository: https://github.com/googleapis/google-cloud-python
- Search StackOverflow: http://stackoverflow.com/questions/tagged/google-cloud-platform+python

If you are still having issues, please be sure to include as much information as possible:

#### Environment details

1. OS type and version
2. Python version and virtual environment information: `python --version`
3. dialogflow version: `pip show dialogflow` or `pip freeze`
- OS type and version:
- Python version: `python --version`
- pip version: `pip --version`
- `dialogflow` version: `pip show dialogflow`

#### Steps to reproduce

1. ?
2. ?

#### Code example

Expand Down
7 changes: 7 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,7 @@
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
- [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/dialogflow-python-client-v2/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
- [ ] Ensure the tests and linter pass
- [ ] Code coverage does not decrease (if any source code was changed)
- [ ] Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> 🦕
2 changes: 1 addition & 1 deletion .github/release-please.yml
@@ -1 +1 @@
releaseType: python
releaseType: python
26 changes: 9 additions & 17 deletions .gitignore
Expand Up @@ -26,27 +26,25 @@ pip-log.txt
# Unit test / coverage reports
.coverage
.nox
.tox
.cache
htmlcov
.pytest_cache

# Translations
*.mo

# Mac
.DS_Store

# Mr Developer
.mr.developer.cfg
.project
.pydevproject

# JetBrains
.idea

# VS Code
.vscode

# emacs
*~

# Built documentation
docs/_build
docs/_build_doc2dash
bigquery/docs/generated

# Virtual environment
env/
Expand All @@ -57,10 +55,4 @@ system_tests/local_test_setup

# Make sure a generated file isn't accidentally committed.
pylintrc
pylintrc.test

# Directories used for creating generated PB2 files
generated_python/
cloud-bigtable-client/
googleapis-pb/
grpc_python_venv/
pylintrc.test
1 change: 0 additions & 1 deletion .kokoro/build.sh
@@ -1,5 +1,4 @@
#!/bin/bash

# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
15 changes: 15 additions & 0 deletions .kokoro/publish-docs.sh
@@ -1,3 +1,18 @@
#!/bin/bash
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

#!/bin/bash

set -eo pipefail
Expand Down
15 changes: 15 additions & 0 deletions .kokoro/release.sh
@@ -1,3 +1,18 @@
#!/bin/bash
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

#!/bin/bash

set -eo pipefail
Expand Down
60 changes: 60 additions & 0 deletions CONTRIBUTING.rst
@@ -1,3 +1,4 @@
.. Generated by synthtool. DO NOT EDIT!
############
Contributing
############
Expand Down Expand Up @@ -135,6 +136,41 @@ Exceptions to PEP8:
"Function-Under-Test"), which is PEP8-incompliant, but more readable.
Some also use a local variable, ``MUT`` (short for "Module-Under-Test").

********************
Running System Tests
********************

- To run system tests, you can execute::

$ nox -s system-3.7
$ nox -s system-2.7

.. 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
of Python 3.

This alone will not run the tests. You'll need to change some local
auth settings and change some configuration in your project to
run all the tests.

- System tests will be run against an actual project and
so you'll need to provide some environment variables to facilitate
authentication to your project:

- ``GOOGLE_APPLICATION_CREDENTIALS``: The path to a JSON key file;
Such a file can be downloaded directly from the developer's console by clicking
"Generate new JSON key". See private key
`docs <https://cloud.google.com/storage/docs/authentication#generating-a-private-key>`__
for more details.

- Once you have downloaded your json keys, set the environment variable
``GOOGLE_APPLICATION_CREDENTIALS`` to the absolute path of the json file::

$ export GOOGLE_APPLICATION_CREDENTIALS="/Users/<your_username>/path/to/app_credentials.json"


*************
Test Coverage
*************
Expand Down Expand Up @@ -188,6 +224,30 @@ Supported versions can be found in our ``noxfile.py`` `config`_.

.. _config: https://github.com/googleapis/dialogflow-python-client-v2/blob/master/noxfile.py

We explicitly decided not to support `Python 2.5`_ due to `decreased usage`_
and lack of continuous integration `support`_.

.. _Python 2.5: https://docs.python.org/2.5/
.. _decreased usage: https://caremad.io/2013/10/a-look-at-pypi-downloads/
.. _support: https://blog.travis-ci.com/2013-11-18-upcoming-build-environment-updates/

We have `dropped 2.6`_ as a supported version as well since Python 2.6 is no
longer supported by the core development team.

Python 2.7 support is deprecated. All code changes should maintain Python 2.7 compatibility until January 1, 2020.

We also explicitly decided to support Python 3 beginning with version
3.5. Reasons for this include:

- Encouraging use of newest versions of Python 3
- Taking the lead of `prominent`_ open-source `projects`_
- `Unicode literal support`_ which allows for a cleaner codebase that
works in both Python 2 and Python 3

.. _prominent: https://docs.djangoproject.com/en/1.9/faq/install/#what-python-version-can-i-use-with-django
.. _projects: http://flask.pocoo.org/docs/0.10/python3/
.. _Unicode literal support: https://www.python.org/dev/peps/pep-0414/
.. _dropped 2.6: https://github.com/googleapis/google-cloud-python/issues/995

**********
Versioning
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
@@ -1,3 +1,4 @@
# Generated by synthtool. DO NOT EDIT!
include README.rst LICENSE
recursive-include google *.json *.proto
recursive-include tests *
Expand Down
78 changes: 78 additions & 0 deletions dialogflow_v2/gapic/agents_client.py
Expand Up @@ -39,6 +39,7 @@
from dialogflow_v2.gapic.transports import agents_grpc_transport
from dialogflow_v2.proto import agent_pb2
from dialogflow_v2.proto import agent_pb2_grpc
from dialogflow_v2.proto import validation_result_pb2
from google.longrunning import operations_pb2
from google.protobuf import empty_pb2
from google.protobuf import field_mask_pb2
Expand Down Expand Up @@ -932,3 +933,80 @@ def restore_agent(
empty_pb2.Empty,
metadata_type=struct_pb2.Struct,
)

def get_validation_result(
self,
parent=None,
language_code=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Gets agent validation result. Agent validation is performed during
training time and is updated automatically when training is completed.
Example:
>>> import dialogflow_v2
>>>
>>> client = dialogflow_v2.AgentsClient()
>>>
>>> response = client.get_validation_result()
Args:
parent (str): Required. The project that the agent is associated with. Format:
``projects/<Project ID>``.
language_code (str): Optional. The language for which you want a validation result. If not
specified, the agent's default language is used. `Many
languages <https://cloud.google.com/dialogflow/docs/reference/language>`__
are supported. Note: languages must be enabled in the agent before they
can be used.
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will
be retried using a default configuration.
timeout (Optional[float]): The amount of time, in seconds, to wait
for the request to complete. Note that if ``retry`` is
specified, the timeout applies to each individual attempt.
metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
that is provided to the method.
Returns:
A :class:`~google.cloud.dialogflow_v2.types.ValidationResult` instance.
Raises:
google.api_core.exceptions.GoogleAPICallError: If the request
failed for any reason.
google.api_core.exceptions.RetryError: If the request failed due
to a retryable error and retry attempts failed.
ValueError: If the parameters are invalid.
"""
# Wrap the transport method to add retry and timeout logic.
if "get_validation_result" not in self._inner_api_calls:
self._inner_api_calls[
"get_validation_result"
] = google.api_core.gapic_v1.method.wrap_method(
self.transport.get_validation_result,
default_retry=self._method_configs["GetValidationResult"].retry,
default_timeout=self._method_configs["GetValidationResult"].timeout,
client_info=self._client_info,
)

request = agent_pb2.GetValidationResultRequest(
parent=parent, language_code=language_code
)
if metadata is None:
metadata = []
metadata = list(metadata)
try:
routing_header = [("parent", parent)]
except AttributeError:
pass
else:
routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
routing_header
)
metadata.append(routing_metadata)

return self._inner_api_calls["get_validation_result"](
request, retry=retry, timeout=timeout, metadata=metadata
)
5 changes: 5 additions & 0 deletions dialogflow_v2/gapic/agents_client_config.py
Expand Up @@ -57,6 +57,11 @@
"retry_codes_name": "idempotent",
"retry_params_name": "default",
},
"GetValidationResult": {
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_params_name": "default",
},
},
}
}
Expand Down
1 change: 1 addition & 0 deletions dialogflow_v2/gapic/contexts_client.py
Expand Up @@ -38,6 +38,7 @@
from dialogflow_v2.proto import agent_pb2_grpc
from dialogflow_v2.proto import context_pb2
from dialogflow_v2.proto import context_pb2_grpc
from dialogflow_v2.proto import validation_result_pb2
from google.longrunning import operations_pb2
from google.protobuf import empty_pb2
from google.protobuf import field_mask_pb2
Expand Down
1 change: 1 addition & 0 deletions dialogflow_v2/gapic/entity_types_client.py
Expand Up @@ -43,6 +43,7 @@
from dialogflow_v2.proto import context_pb2_grpc
from dialogflow_v2.proto import entity_type_pb2
from dialogflow_v2.proto import entity_type_pb2_grpc
from dialogflow_v2.proto import validation_result_pb2
from google.longrunning import operations_pb2
from google.protobuf import empty_pb2
from google.protobuf import field_mask_pb2
Expand Down
20 changes: 20 additions & 0 deletions dialogflow_v2/gapic/enums.py
Expand Up @@ -517,3 +517,23 @@ class MessageType(enum.IntEnum):
MESSAGE_TYPE_UNSPECIFIED = 0
TRANSCRIPT = 1
END_OF_SINGLE_UTTERANCE = 2


class ValidationError(object):
class Severity(enum.IntEnum):
"""
Represents a level of severity.
Attributes:
SEVERITY_UNSPECIFIED (int): Not specified. This value should never be used.
INFO (int): The agent doesn't follow Dialogflow best practicies.
WARNING (int): The agent may not behave as expected.
ERROR (int): The agent may experience partial failures.
CRITICAL (int): The agent may completely fail.
"""

SEVERITY_UNSPECIFIED = 0
INFO = 1
WARNING = 2
ERROR = 3
CRITICAL = 4
1 change: 1 addition & 0 deletions dialogflow_v2/gapic/intents_client.py
Expand Up @@ -45,6 +45,7 @@
from dialogflow_v2.proto import entity_type_pb2_grpc
from dialogflow_v2.proto import intent_pb2
from dialogflow_v2.proto import intent_pb2_grpc
from dialogflow_v2.proto import validation_result_pb2
from google.longrunning import operations_pb2
from google.protobuf import empty_pb2
from google.protobuf import field_mask_pb2
Expand Down
1 change: 1 addition & 0 deletions dialogflow_v2/gapic/session_entity_types_client.py
Expand Up @@ -44,6 +44,7 @@
from dialogflow_v2.proto import intent_pb2_grpc
from dialogflow_v2.proto import session_entity_type_pb2
from dialogflow_v2.proto import session_entity_type_pb2_grpc
from dialogflow_v2.proto import validation_result_pb2
from google.longrunning import operations_pb2
from google.protobuf import empty_pb2
from google.protobuf import field_mask_pb2
Expand Down

0 comments on commit f59ddd2

Please sign in to comment.