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

Commit f59ddd2

Browse files
[CHANGE ME] Re-generated to pick up changes in the API or client library generator.
1 parent 713846b commit f59ddd2

32 files changed

+1203
-715
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,22 @@ Thanks for stopping by to let us know something could be better!
1111
Please run down the following list and make sure you've tried the usual "quick fixes":
1212

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

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

1819
#### Environment details
1920

20-
1. OS type and version
21-
2. Python version and virtual environment information: `python --version`
22-
3. dialogflow version: `pip show dialogflow` or `pip freeze`
21+
- OS type and version:
22+
- Python version: `python --version`
23+
- pip version: `pip --version`
24+
- `dialogflow` version: `pip show dialogflow`
2325

2426
#### Steps to reproduce
2527

2628
1. ?
29+
2. ?
2730

2831
#### Code example
2932

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
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:
2+
- [ ] 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
3+
- [ ] Ensure the tests and linter pass
4+
- [ ] Code coverage does not decrease (if any source code was changed)
5+
- [ ] Appropriate docs were updated (if necessary)
6+
7+
Fixes #<issue_number_goes_here> 🦕

.github/release-please.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
releaseType: python
1+
releaseType: python

.gitignore

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,27 +26,25 @@ pip-log.txt
2626
# Unit test / coverage reports
2727
.coverage
2828
.nox
29-
.tox
3029
.cache
31-
htmlcov
30+
.pytest_cache
3231

33-
# Translations
34-
*.mo
3532

3633
# Mac
3734
.DS_Store
3835

39-
# Mr Developer
40-
.mr.developer.cfg
41-
.project
42-
.pydevproject
43-
4436
# JetBrains
4537
.idea
4638

39+
# VS Code
40+
.vscode
41+
42+
# emacs
43+
*~
44+
4745
# Built documentation
4846
docs/_build
49-
docs/_build_doc2dash
47+
bigquery/docs/generated
5048

5149
# Virtual environment
5250
env/
@@ -57,10 +55,4 @@ system_tests/local_test_setup
5755

5856
# Make sure a generated file isn't accidentally committed.
5957
pylintrc
60-
pylintrc.test
61-
62-
# Directories used for creating generated PB2 files
63-
generated_python/
64-
cloud-bigtable-client/
65-
googleapis-pb/
66-
grpc_python_venv/
58+
pylintrc.test

.kokoro/build.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/bin/bash
2-
32
# Copyright 2018 Google LLC
43
#
54
# Licensed under the Apache License, Version 2.0 (the "License");

.kokoro/publish-docs.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
#!/bin/bash
2+
# Copyright 2020 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# https://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
116
#!/bin/bash
217

318
set -eo pipefail

.kokoro/release.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
#!/bin/bash
2+
# Copyright 2020 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# https://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
116
#!/bin/bash
217

318
set -eo pipefail

CONTRIBUTING.rst

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.. Generated by synthtool. DO NOT EDIT!
12
############
23
Contributing
34
############
@@ -135,6 +136,41 @@ Exceptions to PEP8:
135136
"Function-Under-Test"), which is PEP8-incompliant, but more readable.
136137
Some also use a local variable, ``MUT`` (short for "Module-Under-Test").
137138

139+
********************
140+
Running System Tests
141+
********************
142+
143+
- To run system tests, you can execute::
144+
145+
$ nox -s system-3.7
146+
$ nox -s system-2.7
147+
148+
.. note::
149+
150+
System tests are only configured to run under Python 2.7 and
151+
Python 3.7. For expediency, we do not run them in older versions
152+
of Python 3.
153+
154+
This alone will not run the tests. You'll need to change some local
155+
auth settings and change some configuration in your project to
156+
run all the tests.
157+
158+
- System tests will be run against an actual project and
159+
so you'll need to provide some environment variables to facilitate
160+
authentication to your project:
161+
162+
- ``GOOGLE_APPLICATION_CREDENTIALS``: The path to a JSON key file;
163+
Such a file can be downloaded directly from the developer's console by clicking
164+
"Generate new JSON key". See private key
165+
`docs <https://cloud.google.com/storage/docs/authentication#generating-a-private-key>`__
166+
for more details.
167+
168+
- Once you have downloaded your json keys, set the environment variable
169+
``GOOGLE_APPLICATION_CREDENTIALS`` to the absolute path of the json file::
170+
171+
$ export GOOGLE_APPLICATION_CREDENTIALS="/Users/<your_username>/path/to/app_credentials.json"
172+
173+
138174
*************
139175
Test Coverage
140176
*************
@@ -188,6 +224,30 @@ Supported versions can be found in our ``noxfile.py`` `config`_.
188224

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

227+
We explicitly decided not to support `Python 2.5`_ due to `decreased usage`_
228+
and lack of continuous integration `support`_.
229+
230+
.. _Python 2.5: https://docs.python.org/2.5/
231+
.. _decreased usage: https://caremad.io/2013/10/a-look-at-pypi-downloads/
232+
.. _support: https://blog.travis-ci.com/2013-11-18-upcoming-build-environment-updates/
233+
234+
We have `dropped 2.6`_ as a supported version as well since Python 2.6 is no
235+
longer supported by the core development team.
236+
237+
Python 2.7 support is deprecated. All code changes should maintain Python 2.7 compatibility until January 1, 2020.
238+
239+
We also explicitly decided to support Python 3 beginning with version
240+
3.5. Reasons for this include:
241+
242+
- Encouraging use of newest versions of Python 3
243+
- Taking the lead of `prominent`_ open-source `projects`_
244+
- `Unicode literal support`_ which allows for a cleaner codebase that
245+
works in both Python 2 and Python 3
246+
247+
.. _prominent: https://docs.djangoproject.com/en/1.9/faq/install/#what-python-version-can-i-use-with-django
248+
.. _projects: http://flask.pocoo.org/docs/0.10/python3/
249+
.. _Unicode literal support: https://www.python.org/dev/peps/pep-0414/
250+
.. _dropped 2.6: https://github.com/googleapis/google-cloud-python/issues/995
191251

192252
**********
193253
Versioning

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Generated by synthtool. DO NOT EDIT!
12
include README.rst LICENSE
23
recursive-include google *.json *.proto
34
recursive-include tests *

dialogflow_v2/gapic/agents_client.py

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
from dialogflow_v2.gapic.transports import agents_grpc_transport
4040
from dialogflow_v2.proto import agent_pb2
4141
from dialogflow_v2.proto import agent_pb2_grpc
42+
from dialogflow_v2.proto import validation_result_pb2
4243
from google.longrunning import operations_pb2
4344
from google.protobuf import empty_pb2
4445
from google.protobuf import field_mask_pb2
@@ -932,3 +933,80 @@ def restore_agent(
932933
empty_pb2.Empty,
933934
metadata_type=struct_pb2.Struct,
934935
)
936+
937+
def get_validation_result(
938+
self,
939+
parent=None,
940+
language_code=None,
941+
retry=google.api_core.gapic_v1.method.DEFAULT,
942+
timeout=google.api_core.gapic_v1.method.DEFAULT,
943+
metadata=None,
944+
):
945+
"""
946+
Gets agent validation result. Agent validation is performed during
947+
training time and is updated automatically when training is completed.
948+
949+
Example:
950+
>>> import dialogflow_v2
951+
>>>
952+
>>> client = dialogflow_v2.AgentsClient()
953+
>>>
954+
>>> response = client.get_validation_result()
955+
956+
Args:
957+
parent (str): Required. The project that the agent is associated with. Format:
958+
``projects/<Project ID>``.
959+
language_code (str): Optional. The language for which you want a validation result. If not
960+
specified, the agent's default language is used. `Many
961+
languages <https://cloud.google.com/dialogflow/docs/reference/language>`__
962+
are supported. Note: languages must be enabled in the agent before they
963+
can be used.
964+
retry (Optional[google.api_core.retry.Retry]): A retry object used
965+
to retry requests. If ``None`` is specified, requests will
966+
be retried using a default configuration.
967+
timeout (Optional[float]): The amount of time, in seconds, to wait
968+
for the request to complete. Note that if ``retry`` is
969+
specified, the timeout applies to each individual attempt.
970+
metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
971+
that is provided to the method.
972+
973+
Returns:
974+
A :class:`~google.cloud.dialogflow_v2.types.ValidationResult` instance.
975+
976+
Raises:
977+
google.api_core.exceptions.GoogleAPICallError: If the request
978+
failed for any reason.
979+
google.api_core.exceptions.RetryError: If the request failed due
980+
to a retryable error and retry attempts failed.
981+
ValueError: If the parameters are invalid.
982+
"""
983+
# Wrap the transport method to add retry and timeout logic.
984+
if "get_validation_result" not in self._inner_api_calls:
985+
self._inner_api_calls[
986+
"get_validation_result"
987+
] = google.api_core.gapic_v1.method.wrap_method(
988+
self.transport.get_validation_result,
989+
default_retry=self._method_configs["GetValidationResult"].retry,
990+
default_timeout=self._method_configs["GetValidationResult"].timeout,
991+
client_info=self._client_info,
992+
)
993+
994+
request = agent_pb2.GetValidationResultRequest(
995+
parent=parent, language_code=language_code
996+
)
997+
if metadata is None:
998+
metadata = []
999+
metadata = list(metadata)
1000+
try:
1001+
routing_header = [("parent", parent)]
1002+
except AttributeError:
1003+
pass
1004+
else:
1005+
routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
1006+
routing_header
1007+
)
1008+
metadata.append(routing_metadata)
1009+
1010+
return self._inner_api_calls["get_validation_result"](
1011+
request, retry=retry, timeout=timeout, metadata=metadata
1012+
)

dialogflow_v2/gapic/agents_client_config.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@
5757
"retry_codes_name": "idempotent",
5858
"retry_params_name": "default",
5959
},
60+
"GetValidationResult": {
61+
"timeout_millis": 60000,
62+
"retry_codes_name": "idempotent",
63+
"retry_params_name": "default",
64+
},
6065
},
6166
}
6267
}

dialogflow_v2/gapic/contexts_client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
from dialogflow_v2.proto import agent_pb2_grpc
3939
from dialogflow_v2.proto import context_pb2
4040
from dialogflow_v2.proto import context_pb2_grpc
41+
from dialogflow_v2.proto import validation_result_pb2
4142
from google.longrunning import operations_pb2
4243
from google.protobuf import empty_pb2
4344
from google.protobuf import field_mask_pb2

dialogflow_v2/gapic/entity_types_client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
from dialogflow_v2.proto import context_pb2_grpc
4444
from dialogflow_v2.proto import entity_type_pb2
4545
from dialogflow_v2.proto import entity_type_pb2_grpc
46+
from dialogflow_v2.proto import validation_result_pb2
4647
from google.longrunning import operations_pb2
4748
from google.protobuf import empty_pb2
4849
from google.protobuf import field_mask_pb2

dialogflow_v2/gapic/enums.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,3 +517,23 @@ class MessageType(enum.IntEnum):
517517
MESSAGE_TYPE_UNSPECIFIED = 0
518518
TRANSCRIPT = 1
519519
END_OF_SINGLE_UTTERANCE = 2
520+
521+
522+
class ValidationError(object):
523+
class Severity(enum.IntEnum):
524+
"""
525+
Represents a level of severity.
526+
527+
Attributes:
528+
SEVERITY_UNSPECIFIED (int): Not specified. This value should never be used.
529+
INFO (int): The agent doesn't follow Dialogflow best practicies.
530+
WARNING (int): The agent may not behave as expected.
531+
ERROR (int): The agent may experience partial failures.
532+
CRITICAL (int): The agent may completely fail.
533+
"""
534+
535+
SEVERITY_UNSPECIFIED = 0
536+
INFO = 1
537+
WARNING = 2
538+
ERROR = 3
539+
CRITICAL = 4

dialogflow_v2/gapic/intents_client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
from dialogflow_v2.proto import entity_type_pb2_grpc
4646
from dialogflow_v2.proto import intent_pb2
4747
from dialogflow_v2.proto import intent_pb2_grpc
48+
from dialogflow_v2.proto import validation_result_pb2
4849
from google.longrunning import operations_pb2
4950
from google.protobuf import empty_pb2
5051
from google.protobuf import field_mask_pb2

dialogflow_v2/gapic/session_entity_types_client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
from dialogflow_v2.proto import intent_pb2_grpc
4545
from dialogflow_v2.proto import session_entity_type_pb2
4646
from dialogflow_v2.proto import session_entity_type_pb2_grpc
47+
from dialogflow_v2.proto import validation_result_pb2
4748
from google.longrunning import operations_pb2
4849
from google.protobuf import empty_pb2
4950
from google.protobuf import field_mask_pb2

0 commit comments

Comments
 (0)