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

Commit

Permalink
Browse files Browse the repository at this point in the history
feat: regenerate (#151)
* build: fix synth

* fix: more _pb2 modifications

* docs: fix docstring in intent_pb2

* chore: blacken new additions

* fix: resynth to get lost changes

* chore: blacken tests directory
  • Loading branch information
busunkim96 authored and nnegrey committed Oct 16, 2019
1 parent 72cbc0c commit 6222277
Show file tree
Hide file tree
Showing 109 changed files with 8,224 additions and 8,207 deletions.
1 change: 0 additions & 1 deletion MANIFEST.in
@@ -1,4 +1,3 @@
# Generated by synthtool. DO NOT EDIT!
include README.rst LICENSE
recursive-include google *.json *.proto
recursive-include tests *
Expand Down
1 change: 1 addition & 0 deletions dialogflow_v2/__init__.py
Expand Up @@ -14,6 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.


from __future__ import absolute_import

from dialogflow_v2 import types
Expand Down
243 changes: 187 additions & 56 deletions dialogflow_v2/gapic/agents_client.py

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions dialogflow_v2/gapic/agents_client_config.py
Expand Up @@ -17,6 +17,16 @@
}
},
"methods": {
"SetAgent": {
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_params_name": "default",
},
"DeleteAgent": {
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_params_name": "default",
},
"GetAgent": {
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
Expand Down
53 changes: 35 additions & 18 deletions dialogflow_v2/gapic/contexts_client.py
Expand Up @@ -13,13 +13,15 @@
# 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.

"""Accesses the google.cloud.dialogflow.v2 Contexts API."""

import functools
import pkg_resources
import warnings

from google.oauth2 import service_account
import google.api_core.client_options
import google.api_core.gapic_v1.client_info
import google.api_core.gapic_v1.config
import google.api_core.gapic_v1.method
Expand All @@ -41,6 +43,7 @@
from google.protobuf import field_mask_pb2
from google.protobuf import struct_pb2


_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("dialogflow").version


Expand All @@ -61,7 +64,7 @@ class ContextsClient(object):
matched for a ``DetectIntent`` request.
For more information about contexts, see the `Dialogflow
documentation <https://cloud.google.com/dialogflow-enterprise/docs/contexts-overview>`__.
documentation <https://cloud.google.com/dialogflow/docs/contexts-overview>`__.
"""

SERVICE_ADDRESS = "dialogflow.googleapis.com:443"
Expand Down Expand Up @@ -117,6 +120,7 @@ def __init__(
credentials=None,
client_config=None,
client_info=None,
client_options=None,
):
"""Constructor.
Expand Down Expand Up @@ -147,6 +151,9 @@ def __init__(
API requests. If ``None``, then default info will be used.
Generally, you only need to set this if you're developing
your own client library.
client_options (Union[dict, google.api_core.client_options.ClientOptions]):
Client options used to set user options on the client. API Endpoint
should be set through client_options.
"""
# Raise deprecation warnings for things we want to go away.
if client_config is not None:
Expand All @@ -165,6 +172,15 @@ def __init__(
stacklevel=2,
)

api_endpoint = self.SERVICE_ADDRESS
if client_options:
if type(client_options) == dict:
client_options = google.api_core.client_options.from_dict(
client_options
)
if client_options.api_endpoint:
api_endpoint = client_options.api_endpoint

# Instantiate the transport.
# The transport is responsible for handling serialization and
# deserialization and actually sending data to the service.
Expand All @@ -173,6 +189,7 @@ def __init__(
self.transport = transport(
credentials=credentials,
default_class=contexts_grpc_transport.ContextsGrpcTransport,
address=api_endpoint,
)
else:
if credentials:
Expand All @@ -183,7 +200,7 @@ def __init__(
self.transport = transport
else:
self.transport = contexts_grpc_transport.ContextsGrpcTransport(
address=self.SERVICE_ADDRESS, channel=channel, credentials=credentials
address=api_endpoint, channel=channel, credentials=credentials
)

if client_info is None:
Expand Down Expand Up @@ -250,19 +267,19 @@ def list_contexts(
streaming is performed per-page, this determines the maximum number
of resources in a page.
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will not
be retried.
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.gax.PageIterator` instance. By default, this
is an iterable of :class:`~google.cloud.dialogflow_v2.types.Context` instances.
This object can also be configured to iterate over the pages
of the response through the `options` parameter.
A :class:`~google.api_core.page_iterator.PageIterator` instance.
An iterable of :class:`~google.cloud.dialogflow_v2.types.Context` instances.
You can also iterate over the pages of the response
using its `pages` property.
Raises:
google.api_core.exceptions.GoogleAPICallError: If the request
Expand Down Expand Up @@ -334,8 +351,8 @@ def get_context(
name (str): Required. The name of the context. Format:
``projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context ID>``.
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will not
be retried.
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.
Expand Down Expand Up @@ -414,8 +431,8 @@ def create_context(
If a dict is provided, it must be of the same form as the protobuf
message :class:`~google.cloud.dialogflow_v2.types.Context`
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will not
be retried.
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.
Expand Down Expand Up @@ -492,8 +509,8 @@ def update_context(
If a dict is provided, it must be of the same form as the protobuf
message :class:`~google.cloud.dialogflow_v2.types.FieldMask`
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will not
be retried.
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.
Expand Down Expand Up @@ -564,8 +581,8 @@ def delete_context(
name (str): Required. The name of the context to delete. Format:
``projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context ID>``.
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will not
be retried.
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.
Expand Down Expand Up @@ -631,8 +648,8 @@ def delete_all_contexts(
parent (str): Required. The name of the session to delete all contexts from. Format:
``projects/<Project ID>/agent/sessions/<Session ID>``.
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will not
be retried.
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.
Expand Down

0 comments on commit 6222277

Please sign in to comment.