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

Commit d2dcc14

Browse files
fix: remove gRPC send/recv limits; add enums to __init__.py (#94)
* changes without context autosynth cannot find the source of changes triggered by earlier changes in this repository, or by version upgrades to tools such as linters. * build(java): use actions/github-script v3 tag rather than full semver So that renovate-bot stops proposing PRs like [this](https://github.com/googleapis/java-bigquerydatatransfer/pull/515/files)! Source-Author: Stephanie Wang <stephaniewang526@users.noreply.github.com> Source-Date: Tue Nov 17 13:02:02 2020 -0500 Source-Repo: googleapis/synthtool Source-Sha: 7fcc405a579d5d53a726ff3da1b7c8c08f0f2d58 Source-Link: googleapis/synthtool@7fcc405 * fix: remove client recv msg limit fix: add enums to `types/__init__.py` PiperOrigin-RevId: 347055288 Source-Author: Google APIs <noreply@google.com> Source-Date: Fri Dec 11 12:44:37 2020 -0800 Source-Repo: googleapis/googleapis Source-Sha: dd372aa22ded7a8ba6f0e03a80e06358a3fa0907 Source-Link: googleapis/googleapis@dd372aa
1 parent e4bbbad commit d2dcc14

File tree

30 files changed

+225
-60
lines changed

30 files changed

+225
-60
lines changed

google/cloud/videointelligence_v1/services/video_intelligence_service/transports/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
_transport_registry["grpc"] = VideoIntelligenceServiceGrpcTransport
3131
_transport_registry["grpc_asyncio"] = VideoIntelligenceServiceGrpcAsyncIOTransport
3232

33-
3433
__all__ = (
3534
"VideoIntelligenceServiceTransport",
3635
"VideoIntelligenceServiceGrpcTransport",

google/cloud/videointelligence_v1/services/video_intelligence_service/transports/grpc.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ def __init__(
148148
ssl_credentials=ssl_credentials,
149149
scopes=scopes or self.AUTH_SCOPES,
150150
quota_project_id=quota_project_id,
151+
options=[
152+
("grpc.max_send_message_length", -1),
153+
("grpc.max_receive_message_length", -1),
154+
],
151155
)
152156
self._ssl_channel_credentials = ssl_credentials
153157
else:
@@ -166,9 +170,14 @@ def __init__(
166170
ssl_credentials=ssl_channel_credentials,
167171
scopes=scopes or self.AUTH_SCOPES,
168172
quota_project_id=quota_project_id,
173+
options=[
174+
("grpc.max_send_message_length", -1),
175+
("grpc.max_receive_message_length", -1),
176+
],
169177
)
170178

171179
self._stubs = {} # type: Dict[str, Callable]
180+
self._operations_client = None
172181

173182
# Run the base constructor.
174183
super().__init__(
@@ -192,7 +201,7 @@ def create_channel(
192201
) -> grpc.Channel:
193202
"""Create and return a gRPC channel object.
194203
Args:
195-
address (Optionsl[str]): The host for the channel to use.
204+
address (Optional[str]): The host for the channel to use.
196205
credentials (Optional[~.Credentials]): The
197206
authorization credentials to attach to requests. These
198207
credentials identify this application to the service. If
@@ -239,13 +248,11 @@ def operations_client(self) -> operations_v1.OperationsClient:
239248
client.
240249
"""
241250
# Sanity check: Only create a new client if we do not already have one.
242-
if "operations_client" not in self.__dict__:
243-
self.__dict__["operations_client"] = operations_v1.OperationsClient(
244-
self.grpc_channel
245-
)
251+
if self._operations_client is None:
252+
self._operations_client = operations_v1.OperationsClient(self.grpc_channel)
246253

247254
# Return the client from cache.
248-
return self.__dict__["operations_client"]
255+
return self._operations_client
249256

250257
@property
251258
def annotate_video(

google/cloud/videointelligence_v1/services/video_intelligence_service/transports/grpc_asyncio.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,10 @@ def __init__(
193193
ssl_credentials=ssl_credentials,
194194
scopes=scopes or self.AUTH_SCOPES,
195195
quota_project_id=quota_project_id,
196+
options=[
197+
("grpc.max_send_message_length", -1),
198+
("grpc.max_receive_message_length", -1),
199+
],
196200
)
197201
self._ssl_channel_credentials = ssl_credentials
198202
else:
@@ -211,6 +215,10 @@ def __init__(
211215
ssl_credentials=ssl_channel_credentials,
212216
scopes=scopes or self.AUTH_SCOPES,
213217
quota_project_id=quota_project_id,
218+
options=[
219+
("grpc.max_send_message_length", -1),
220+
("grpc.max_receive_message_length", -1),
221+
],
214222
)
215223

216224
# Run the base constructor.
@@ -224,6 +232,7 @@ def __init__(
224232
)
225233

226234
self._stubs = {}
235+
self._operations_client = None
227236

228237
@property
229238
def grpc_channel(self) -> aio.Channel:
@@ -243,13 +252,13 @@ def operations_client(self) -> operations_v1.OperationsAsyncClient:
243252
client.
244253
"""
245254
# Sanity check: Only create a new client if we do not already have one.
246-
if "operations_client" not in self.__dict__:
247-
self.__dict__["operations_client"] = operations_v1.OperationsAsyncClient(
255+
if self._operations_client is None:
256+
self._operations_client = operations_v1.OperationsAsyncClient(
248257
self.grpc_channel
249258
)
250259

251260
# Return the client from cache.
252-
return self.__dict__["operations_client"]
261+
return self._operations_client
253262

254263
@property
255264
def annotate_video(

google/cloud/videointelligence_v1/types/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,11 @@
5959
ObjectTrackingFrame,
6060
ObjectTrackingAnnotation,
6161
LogoRecognitionAnnotation,
62+
Feature,
63+
LabelDetectionMode,
64+
Likelihood,
6265
)
6366

64-
6567
__all__ = (
6668
"AnnotateVideoRequest",
6769
"VideoContext",
@@ -106,4 +108,7 @@
106108
"ObjectTrackingFrame",
107109
"ObjectTrackingAnnotation",
108110
"LogoRecognitionAnnotation",
111+
"Feature",
112+
"LabelDetectionMode",
113+
"Likelihood",
109114
)

google/cloud/videointelligence_v1beta2/services/video_intelligence_service/transports/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
_transport_registry["grpc"] = VideoIntelligenceServiceGrpcTransport
3131
_transport_registry["grpc_asyncio"] = VideoIntelligenceServiceGrpcAsyncIOTransport
3232

33-
3433
__all__ = (
3534
"VideoIntelligenceServiceTransport",
3635
"VideoIntelligenceServiceGrpcTransport",

google/cloud/videointelligence_v1beta2/services/video_intelligence_service/transports/grpc.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ def __init__(
148148
ssl_credentials=ssl_credentials,
149149
scopes=scopes or self.AUTH_SCOPES,
150150
quota_project_id=quota_project_id,
151+
options=[
152+
("grpc.max_send_message_length", -1),
153+
("grpc.max_receive_message_length", -1),
154+
],
151155
)
152156
self._ssl_channel_credentials = ssl_credentials
153157
else:
@@ -166,9 +170,14 @@ def __init__(
166170
ssl_credentials=ssl_channel_credentials,
167171
scopes=scopes or self.AUTH_SCOPES,
168172
quota_project_id=quota_project_id,
173+
options=[
174+
("grpc.max_send_message_length", -1),
175+
("grpc.max_receive_message_length", -1),
176+
],
169177
)
170178

171179
self._stubs = {} # type: Dict[str, Callable]
180+
self._operations_client = None
172181

173182
# Run the base constructor.
174183
super().__init__(
@@ -192,7 +201,7 @@ def create_channel(
192201
) -> grpc.Channel:
193202
"""Create and return a gRPC channel object.
194203
Args:
195-
address (Optionsl[str]): The host for the channel to use.
204+
address (Optional[str]): The host for the channel to use.
196205
credentials (Optional[~.Credentials]): The
197206
authorization credentials to attach to requests. These
198207
credentials identify this application to the service. If
@@ -239,13 +248,11 @@ def operations_client(self) -> operations_v1.OperationsClient:
239248
client.
240249
"""
241250
# Sanity check: Only create a new client if we do not already have one.
242-
if "operations_client" not in self.__dict__:
243-
self.__dict__["operations_client"] = operations_v1.OperationsClient(
244-
self.grpc_channel
245-
)
251+
if self._operations_client is None:
252+
self._operations_client = operations_v1.OperationsClient(self.grpc_channel)
246253

247254
# Return the client from cache.
248-
return self.__dict__["operations_client"]
255+
return self._operations_client
249256

250257
@property
251258
def annotate_video(

google/cloud/videointelligence_v1beta2/services/video_intelligence_service/transports/grpc_asyncio.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,10 @@ def __init__(
193193
ssl_credentials=ssl_credentials,
194194
scopes=scopes or self.AUTH_SCOPES,
195195
quota_project_id=quota_project_id,
196+
options=[
197+
("grpc.max_send_message_length", -1),
198+
("grpc.max_receive_message_length", -1),
199+
],
196200
)
197201
self._ssl_channel_credentials = ssl_credentials
198202
else:
@@ -211,6 +215,10 @@ def __init__(
211215
ssl_credentials=ssl_channel_credentials,
212216
scopes=scopes or self.AUTH_SCOPES,
213217
quota_project_id=quota_project_id,
218+
options=[
219+
("grpc.max_send_message_length", -1),
220+
("grpc.max_receive_message_length", -1),
221+
],
214222
)
215223

216224
# Run the base constructor.
@@ -224,6 +232,7 @@ def __init__(
224232
)
225233

226234
self._stubs = {}
235+
self._operations_client = None
227236

228237
@property
229238
def grpc_channel(self) -> aio.Channel:
@@ -243,13 +252,13 @@ def operations_client(self) -> operations_v1.OperationsAsyncClient:
243252
client.
244253
"""
245254
# Sanity check: Only create a new client if we do not already have one.
246-
if "operations_client" not in self.__dict__:
247-
self.__dict__["operations_client"] = operations_v1.OperationsAsyncClient(
255+
if self._operations_client is None:
256+
self._operations_client = operations_v1.OperationsAsyncClient(
248257
self.grpc_channel
249258
)
250259

251260
# Return the client from cache.
252-
return self.__dict__["operations_client"]
261+
return self._operations_client
253262

254263
@property
255264
def annotate_video(

google/cloud/videointelligence_v1beta2/types/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,11 @@
3737
AnnotateVideoResponse,
3838
VideoAnnotationProgress,
3939
AnnotateVideoProgress,
40+
Feature,
41+
LabelDetectionMode,
42+
Likelihood,
4043
)
4144

42-
4345
__all__ = (
4446
"AnnotateVideoRequest",
4547
"VideoContext",
@@ -62,4 +64,7 @@
6264
"AnnotateVideoResponse",
6365
"VideoAnnotationProgress",
6466
"AnnotateVideoProgress",
67+
"Feature",
68+
"LabelDetectionMode",
69+
"Likelihood",
6570
)

google/cloud/videointelligence_v1p1beta1/services/video_intelligence_service/transports/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
_transport_registry["grpc"] = VideoIntelligenceServiceGrpcTransport
3131
_transport_registry["grpc_asyncio"] = VideoIntelligenceServiceGrpcAsyncIOTransport
3232

33-
3433
__all__ = (
3534
"VideoIntelligenceServiceTransport",
3635
"VideoIntelligenceServiceGrpcTransport",

google/cloud/videointelligence_v1p1beta1/services/video_intelligence_service/transports/grpc.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ def __init__(
148148
ssl_credentials=ssl_credentials,
149149
scopes=scopes or self.AUTH_SCOPES,
150150
quota_project_id=quota_project_id,
151+
options=[
152+
("grpc.max_send_message_length", -1),
153+
("grpc.max_receive_message_length", -1),
154+
],
151155
)
152156
self._ssl_channel_credentials = ssl_credentials
153157
else:
@@ -166,9 +170,14 @@ def __init__(
166170
ssl_credentials=ssl_channel_credentials,
167171
scopes=scopes or self.AUTH_SCOPES,
168172
quota_project_id=quota_project_id,
173+
options=[
174+
("grpc.max_send_message_length", -1),
175+
("grpc.max_receive_message_length", -1),
176+
],
169177
)
170178

171179
self._stubs = {} # type: Dict[str, Callable]
180+
self._operations_client = None
172181

173182
# Run the base constructor.
174183
super().__init__(
@@ -192,7 +201,7 @@ def create_channel(
192201
) -> grpc.Channel:
193202
"""Create and return a gRPC channel object.
194203
Args:
195-
address (Optionsl[str]): The host for the channel to use.
204+
address (Optional[str]): The host for the channel to use.
196205
credentials (Optional[~.Credentials]): The
197206
authorization credentials to attach to requests. These
198207
credentials identify this application to the service. If
@@ -239,13 +248,11 @@ def operations_client(self) -> operations_v1.OperationsClient:
239248
client.
240249
"""
241250
# Sanity check: Only create a new client if we do not already have one.
242-
if "operations_client" not in self.__dict__:
243-
self.__dict__["operations_client"] = operations_v1.OperationsClient(
244-
self.grpc_channel
245-
)
251+
if self._operations_client is None:
252+
self._operations_client = operations_v1.OperationsClient(self.grpc_channel)
246253

247254
# Return the client from cache.
248-
return self.__dict__["operations_client"]
255+
return self._operations_client
249256

250257
@property
251258
def annotate_video(

0 commit comments

Comments
 (0)