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

Commit 6222277

Browse files
busunkim96nnegrey
authored andcommitted
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
1 parent 72cbc0c commit 6222277

File tree

109 files changed

+8224
-8207
lines changed

Some content is hidden

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

109 files changed

+8224
-8207
lines changed

MANIFEST.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# Generated by synthtool. DO NOT EDIT!
21
include README.rst LICENSE
32
recursive-include google *.json *.proto
43
recursive-include tests *

dialogflow_v2/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17+
1718
from __future__ import absolute_import
1819

1920
from dialogflow_v2 import types

dialogflow_v2/gapic/agents_client.py

Lines changed: 187 additions & 56 deletions
Large diffs are not rendered by default.

dialogflow_v2/gapic/agents_client_config.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@
1717
}
1818
},
1919
"methods": {
20+
"SetAgent": {
21+
"timeout_millis": 60000,
22+
"retry_codes_name": "idempotent",
23+
"retry_params_name": "default",
24+
},
25+
"DeleteAgent": {
26+
"timeout_millis": 60000,
27+
"retry_codes_name": "idempotent",
28+
"retry_params_name": "default",
29+
},
2030
"GetAgent": {
2131
"timeout_millis": 60000,
2232
"retry_codes_name": "idempotent",

dialogflow_v2/gapic/contexts_client.py

Lines changed: 35 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@
1313
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
16+
1617
"""Accesses the google.cloud.dialogflow.v2 Contexts API."""
1718

1819
import functools
1920
import pkg_resources
2021
import warnings
2122

2223
from google.oauth2 import service_account
24+
import google.api_core.client_options
2325
import google.api_core.gapic_v1.client_info
2426
import google.api_core.gapic_v1.config
2527
import google.api_core.gapic_v1.method
@@ -41,6 +43,7 @@
4143
from google.protobuf import field_mask_pb2
4244
from google.protobuf import struct_pb2
4345

46+
4447
_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("dialogflow").version
4548

4649

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

6770
SERVICE_ADDRESS = "dialogflow.googleapis.com:443"
@@ -117,6 +120,7 @@ def __init__(
117120
credentials=None,
118121
client_config=None,
119122
client_info=None,
123+
client_options=None,
120124
):
121125
"""Constructor.
122126
@@ -147,6 +151,9 @@ def __init__(
147151
API requests. If ``None``, then default info will be used.
148152
Generally, you only need to set this if you're developing
149153
your own client library.
154+
client_options (Union[dict, google.api_core.client_options.ClientOptions]):
155+
Client options used to set user options on the client. API Endpoint
156+
should be set through client_options.
150157
"""
151158
# Raise deprecation warnings for things we want to go away.
152159
if client_config is not None:
@@ -165,6 +172,15 @@ def __init__(
165172
stacklevel=2,
166173
)
167174

175+
api_endpoint = self.SERVICE_ADDRESS
176+
if client_options:
177+
if type(client_options) == dict:
178+
client_options = google.api_core.client_options.from_dict(
179+
client_options
180+
)
181+
if client_options.api_endpoint:
182+
api_endpoint = client_options.api_endpoint
183+
168184
# Instantiate the transport.
169185
# The transport is responsible for handling serialization and
170186
# deserialization and actually sending data to the service.
@@ -173,6 +189,7 @@ def __init__(
173189
self.transport = transport(
174190
credentials=credentials,
175191
default_class=contexts_grpc_transport.ContextsGrpcTransport,
192+
address=api_endpoint,
176193
)
177194
else:
178195
if credentials:
@@ -183,7 +200,7 @@ def __init__(
183200
self.transport = transport
184201
else:
185202
self.transport = contexts_grpc_transport.ContextsGrpcTransport(
186-
address=self.SERVICE_ADDRESS, channel=channel, credentials=credentials
203+
address=api_endpoint, channel=channel, credentials=credentials
187204
)
188205

189206
if client_info is None:
@@ -250,19 +267,19 @@ def list_contexts(
250267
streaming is performed per-page, this determines the maximum number
251268
of resources in a page.
252269
retry (Optional[google.api_core.retry.Retry]): A retry object used
253-
to retry requests. If ``None`` is specified, requests will not
254-
be retried.
270+
to retry requests. If ``None`` is specified, requests will
271+
be retried using a default configuration.
255272
timeout (Optional[float]): The amount of time, in seconds, to wait
256273
for the request to complete. Note that if ``retry`` is
257274
specified, the timeout applies to each individual attempt.
258275
metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
259276
that is provided to the method.
260277
261278
Returns:
262-
A :class:`~google.gax.PageIterator` instance. By default, this
263-
is an iterable of :class:`~google.cloud.dialogflow_v2.types.Context` instances.
264-
This object can also be configured to iterate over the pages
265-
of the response through the `options` parameter.
279+
A :class:`~google.api_core.page_iterator.PageIterator` instance.
280+
An iterable of :class:`~google.cloud.dialogflow_v2.types.Context` instances.
281+
You can also iterate over the pages of the response
282+
using its `pages` property.
266283
267284
Raises:
268285
google.api_core.exceptions.GoogleAPICallError: If the request
@@ -334,8 +351,8 @@ def get_context(
334351
name (str): Required. The name of the context. Format:
335352
``projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context ID>``.
336353
retry (Optional[google.api_core.retry.Retry]): A retry object used
337-
to retry requests. If ``None`` is specified, requests will not
338-
be retried.
354+
to retry requests. If ``None`` is specified, requests will
355+
be retried using a default configuration.
339356
timeout (Optional[float]): The amount of time, in seconds, to wait
340357
for the request to complete. Note that if ``retry`` is
341358
specified, the timeout applies to each individual attempt.
@@ -414,8 +431,8 @@ def create_context(
414431
If a dict is provided, it must be of the same form as the protobuf
415432
message :class:`~google.cloud.dialogflow_v2.types.Context`
416433
retry (Optional[google.api_core.retry.Retry]): A retry object used
417-
to retry requests. If ``None`` is specified, requests will not
418-
be retried.
434+
to retry requests. If ``None`` is specified, requests will
435+
be retried using a default configuration.
419436
timeout (Optional[float]): The amount of time, in seconds, to wait
420437
for the request to complete. Note that if ``retry`` is
421438
specified, the timeout applies to each individual attempt.
@@ -492,8 +509,8 @@ def update_context(
492509
If a dict is provided, it must be of the same form as the protobuf
493510
message :class:`~google.cloud.dialogflow_v2.types.FieldMask`
494511
retry (Optional[google.api_core.retry.Retry]): A retry object used
495-
to retry requests. If ``None`` is specified, requests will not
496-
be retried.
512+
to retry requests. If ``None`` is specified, requests will
513+
be retried using a default configuration.
497514
timeout (Optional[float]): The amount of time, in seconds, to wait
498515
for the request to complete. Note that if ``retry`` is
499516
specified, the timeout applies to each individual attempt.
@@ -564,8 +581,8 @@ def delete_context(
564581
name (str): Required. The name of the context to delete. Format:
565582
``projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context ID>``.
566583
retry (Optional[google.api_core.retry.Retry]): A retry object used
567-
to retry requests. If ``None`` is specified, requests will not
568-
be retried.
584+
to retry requests. If ``None`` is specified, requests will
585+
be retried using a default configuration.
569586
timeout (Optional[float]): The amount of time, in seconds, to wait
570587
for the request to complete. Note that if ``retry`` is
571588
specified, the timeout applies to each individual attempt.
@@ -631,8 +648,8 @@ def delete_all_contexts(
631648
parent (str): Required. The name of the session to delete all contexts from. Format:
632649
``projects/<Project ID>/agent/sessions/<Session ID>``.
633650
retry (Optional[google.api_core.retry.Retry]): A retry object used
634-
to retry requests. If ``None`` is specified, requests will not
635-
be retried.
651+
to retry requests. If ``None`` is specified, requests will
652+
be retried using a default configuration.
636653
timeout (Optional[float]): The amount of time, in seconds, to wait
637654
for the request to complete. Note that if ``retry`` is
638655
specified, the timeout applies to each individual attempt.

0 commit comments

Comments
 (0)