Skip to content
This repository was archived by the owner on Jan 6, 2024. It is now read-only.

Commit 09919b0

Browse files
feat: allowed custom to specify webhook headers through query parameters (#32)
feat: allowed custom to specify webhook headers through query parameters (#32) fix: remove gRPC send/recv limit; add enums to `types/__init__.py`
1 parent 6a49271 commit 09919b0

File tree

102 files changed

+1104
-181
lines changed

Some content is hidden

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

102 files changed

+1104
-181
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# See https://pre-commit.com/hooks.html for more hooks
33
repos:
44
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: v3.3.0
5+
rev: v3.4.0
66
hooks:
77
- id: trailing-whitespace
88
- id: end-of-file-fixer

google/cloud/dialogflowcx_v3/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@
194194
"ExportAgentRequest",
195195
"ExportAgentResponse",
196196
"Flow",
197-
"FlowsClient",
198197
"Form",
199198
"FulfillIntentRequest",
200199
"FulfillIntentResponse",
@@ -292,4 +291,5 @@
292291
"WebhookRequest",
293292
"WebhookResponse",
294293
"WebhooksClient",
294+
"FlowsClient",
295295
)

google/cloud/dialogflowcx_v3/services/agents/transports/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
_transport_registry["grpc"] = AgentsGrpcTransport
2929
_transport_registry["grpc_asyncio"] = AgentsGrpcAsyncIOTransport
3030

31-
3231
__all__ = (
3332
"AgentsTransport",
3433
"AgentsGrpcTransport",

google/cloud/dialogflowcx_v3/services/agents/transports/grpc.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,10 @@ def __init__(
150150
ssl_credentials=ssl_credentials,
151151
scopes=scopes or self.AUTH_SCOPES,
152152
quota_project_id=quota_project_id,
153+
options=[
154+
("grpc.max_send_message_length", -1),
155+
("grpc.max_receive_message_length", -1),
156+
],
153157
)
154158
self._ssl_channel_credentials = ssl_credentials
155159
else:
@@ -168,9 +172,14 @@ def __init__(
168172
ssl_credentials=ssl_channel_credentials,
169173
scopes=scopes or self.AUTH_SCOPES,
170174
quota_project_id=quota_project_id,
175+
options=[
176+
("grpc.max_send_message_length", -1),
177+
("grpc.max_receive_message_length", -1),
178+
],
171179
)
172180

173181
self._stubs = {} # type: Dict[str, Callable]
182+
self._operations_client = None
174183

175184
# Run the base constructor.
176185
super().__init__(
@@ -194,7 +203,7 @@ def create_channel(
194203
) -> grpc.Channel:
195204
"""Create and return a gRPC channel object.
196205
Args:
197-
address (Optionsl[str]): The host for the channel to use.
206+
address (Optional[str]): The host for the channel to use.
198207
credentials (Optional[~.Credentials]): The
199208
authorization credentials to attach to requests. These
200209
credentials identify this application to the service. If
@@ -241,13 +250,11 @@ def operations_client(self) -> operations_v1.OperationsClient:
241250
client.
242251
"""
243252
# Sanity check: Only create a new client if we do not already have one.
244-
if "operations_client" not in self.__dict__:
245-
self.__dict__["operations_client"] = operations_v1.OperationsClient(
246-
self.grpc_channel
247-
)
253+
if self._operations_client is None:
254+
self._operations_client = operations_v1.OperationsClient(self.grpc_channel)
248255

249256
# Return the client from cache.
250-
return self.__dict__["operations_client"]
257+
return self._operations_client
251258

252259
@property
253260
def list_agents(

google/cloud/dialogflowcx_v3/services/agents/transports/grpc_asyncio.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,10 @@ def __init__(
195195
ssl_credentials=ssl_credentials,
196196
scopes=scopes or self.AUTH_SCOPES,
197197
quota_project_id=quota_project_id,
198+
options=[
199+
("grpc.max_send_message_length", -1),
200+
("grpc.max_receive_message_length", -1),
201+
],
198202
)
199203
self._ssl_channel_credentials = ssl_credentials
200204
else:
@@ -213,6 +217,10 @@ def __init__(
213217
ssl_credentials=ssl_channel_credentials,
214218
scopes=scopes or self.AUTH_SCOPES,
215219
quota_project_id=quota_project_id,
220+
options=[
221+
("grpc.max_send_message_length", -1),
222+
("grpc.max_receive_message_length", -1),
223+
],
216224
)
217225

218226
# Run the base constructor.
@@ -226,6 +234,7 @@ def __init__(
226234
)
227235

228236
self._stubs = {}
237+
self._operations_client = None
229238

230239
@property
231240
def grpc_channel(self) -> aio.Channel:
@@ -245,13 +254,13 @@ def operations_client(self) -> operations_v1.OperationsAsyncClient:
245254
client.
246255
"""
247256
# Sanity check: Only create a new client if we do not already have one.
248-
if "operations_client" not in self.__dict__:
249-
self.__dict__["operations_client"] = operations_v1.OperationsAsyncClient(
257+
if self._operations_client is None:
258+
self._operations_client = operations_v1.OperationsAsyncClient(
250259
self.grpc_channel
251260
)
252261

253262
# Return the client from cache.
254-
return self.__dict__["operations_client"]
263+
return self._operations_client
255264

256265
@property
257266
def list_agents(

google/cloud/dialogflowcx_v3/services/entity_types/transports/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
_transport_registry["grpc"] = EntityTypesGrpcTransport
2929
_transport_registry["grpc_asyncio"] = EntityTypesGrpcAsyncIOTransport
3030

31-
3231
__all__ = (
3332
"EntityTypesTransport",
3433
"EntityTypesGrpcTransport",

google/cloud/dialogflowcx_v3/services/entity_types/transports/grpc.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,10 @@ def __init__(
149149
ssl_credentials=ssl_credentials,
150150
scopes=scopes or self.AUTH_SCOPES,
151151
quota_project_id=quota_project_id,
152+
options=[
153+
("grpc.max_send_message_length", -1),
154+
("grpc.max_receive_message_length", -1),
155+
],
152156
)
153157
self._ssl_channel_credentials = ssl_credentials
154158
else:
@@ -167,6 +171,10 @@ def __init__(
167171
ssl_credentials=ssl_channel_credentials,
168172
scopes=scopes or self.AUTH_SCOPES,
169173
quota_project_id=quota_project_id,
174+
options=[
175+
("grpc.max_send_message_length", -1),
176+
("grpc.max_receive_message_length", -1),
177+
],
170178
)
171179

172180
self._stubs = {} # type: Dict[str, Callable]
@@ -193,7 +201,7 @@ def create_channel(
193201
) -> grpc.Channel:
194202
"""Create and return a gRPC channel object.
195203
Args:
196-
address (Optionsl[str]): The host for the channel to use.
204+
address (Optional[str]): The host for the channel to use.
197205
credentials (Optional[~.Credentials]): The
198206
authorization credentials to attach to requests. These
199207
credentials identify this application to the service. If

google/cloud/dialogflowcx_v3/services/entity_types/transports/grpc_asyncio.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,10 @@ def __init__(
194194
ssl_credentials=ssl_credentials,
195195
scopes=scopes or self.AUTH_SCOPES,
196196
quota_project_id=quota_project_id,
197+
options=[
198+
("grpc.max_send_message_length", -1),
199+
("grpc.max_receive_message_length", -1),
200+
],
197201
)
198202
self._ssl_channel_credentials = ssl_credentials
199203
else:
@@ -212,6 +216,10 @@ def __init__(
212216
ssl_credentials=ssl_channel_credentials,
213217
scopes=scopes or self.AUTH_SCOPES,
214218
quota_project_id=quota_project_id,
219+
options=[
220+
("grpc.max_send_message_length", -1),
221+
("grpc.max_receive_message_length", -1),
222+
],
215223
)
216224

217225
# Run the base constructor.

google/cloud/dialogflowcx_v3/services/environments/transports/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
_transport_registry["grpc"] = EnvironmentsGrpcTransport
2929
_transport_registry["grpc_asyncio"] = EnvironmentsGrpcAsyncIOTransport
3030

31-
3231
__all__ = (
3332
"EnvironmentsTransport",
3433
"EnvironmentsGrpcTransport",

google/cloud/dialogflowcx_v3/services/environments/transports/grpc.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,10 @@ def __init__(
151151
ssl_credentials=ssl_credentials,
152152
scopes=scopes or self.AUTH_SCOPES,
153153
quota_project_id=quota_project_id,
154+
options=[
155+
("grpc.max_send_message_length", -1),
156+
("grpc.max_receive_message_length", -1),
157+
],
154158
)
155159
self._ssl_channel_credentials = ssl_credentials
156160
else:
@@ -169,9 +173,14 @@ def __init__(
169173
ssl_credentials=ssl_channel_credentials,
170174
scopes=scopes or self.AUTH_SCOPES,
171175
quota_project_id=quota_project_id,
176+
options=[
177+
("grpc.max_send_message_length", -1),
178+
("grpc.max_receive_message_length", -1),
179+
],
172180
)
173181

174182
self._stubs = {} # type: Dict[str, Callable]
183+
self._operations_client = None
175184

176185
# Run the base constructor.
177186
super().__init__(
@@ -195,7 +204,7 @@ def create_channel(
195204
) -> grpc.Channel:
196205
"""Create and return a gRPC channel object.
197206
Args:
198-
address (Optionsl[str]): The host for the channel to use.
207+
address (Optional[str]): The host for the channel to use.
199208
credentials (Optional[~.Credentials]): The
200209
authorization credentials to attach to requests. These
201210
credentials identify this application to the service. If
@@ -242,13 +251,11 @@ def operations_client(self) -> operations_v1.OperationsClient:
242251
client.
243252
"""
244253
# Sanity check: Only create a new client if we do not already have one.
245-
if "operations_client" not in self.__dict__:
246-
self.__dict__["operations_client"] = operations_v1.OperationsClient(
247-
self.grpc_channel
248-
)
254+
if self._operations_client is None:
255+
self._operations_client = operations_v1.OperationsClient(self.grpc_channel)
249256

250257
# Return the client from cache.
251-
return self.__dict__["operations_client"]
258+
return self._operations_client
252259

253260
@property
254261
def list_environments(

0 commit comments

Comments
 (0)