Skip to content

Commit ca20aaf

Browse files
authored
Videointelligence: pick up fixes to GAPIC generator. (#6578)
Includes fixes from these PRs: - googleapis/gapic-generator#2407 (closing googleapis/gapic-generator#2389) - googleapis/gapic-generator#2396 (for #5523 and dupes). Includes changes to generated tests. Closes #6512.
1 parent 143f59c commit ca20aaf

16 files changed

Lines changed: 349 additions & 65 deletions

videointelligence/google/cloud/videointelligence_v1/gapic/transports/video_intelligence_service_grpc_transport.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ def __init__(self,
6363
credentials=credentials,
6464
)
6565

66+
self._channel = channel
67+
6668
# gRPC uses objects called "stubs" that are bound to the
6769
# channel and provide a basic method for each RPC.
6870
self._stubs = {
@@ -99,6 +101,15 @@ def create_channel(cls,
99101
scopes=cls._OAUTH_SCOPES,
100102
)
101103

104+
@property
105+
def channel(self):
106+
"""The gRPC channel used by the transport.
107+
108+
Returns:
109+
grpc.Channel: A gRPC channel object.
110+
"""
111+
return self._channel
112+
102113
@property
103114
def annotate_video(self):
104115
"""Return the gRPC stub for {$apiMethod.name}.

videointelligence/google/cloud/videointelligence_v1/gapic/video_intelligence_service_client.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def __init__(self,
7373
transport=None,
7474
channel=None,
7575
credentials=None,
76-
client_config=video_intelligence_service_client_config.config,
76+
client_config=None,
7777
client_info=None):
7878
"""Constructor.
7979
@@ -106,13 +106,20 @@ def __init__(self,
106106
your own client library.
107107
"""
108108
# Raise deprecation warnings for things we want to go away.
109-
if client_config:
110-
warnings.warn('The `client_config` argument is deprecated.',
111-
PendingDeprecationWarning)
109+
if client_config is not None:
110+
warnings.warn(
111+
'The `client_config` argument is deprecated.',
112+
PendingDeprecationWarning,
113+
stacklevel=2)
114+
else:
115+
client_config = video_intelligence_service_client_config.config
116+
112117
if channel:
113118
warnings.warn(
114119
'The `channel` argument is deprecated; use '
115-
'`transport` instead.', PendingDeprecationWarning)
120+
'`transport` instead.',
121+
PendingDeprecationWarning,
122+
stacklevel=2)
116123

117124
# Instantiate the transport.
118125
# The transport is responsible for handling serialization and

videointelligence/google/cloud/videointelligence_v1beta1/gapic/transports/video_intelligence_service_grpc_transport.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ def __init__(self,
6363
credentials=credentials,
6464
)
6565

66+
self._channel = channel
67+
6668
# gRPC uses objects called "stubs" that are bound to the
6769
# channel and provide a basic method for each RPC.
6870
self._stubs = {
@@ -99,6 +101,15 @@ def create_channel(cls,
99101
scopes=cls._OAUTH_SCOPES,
100102
)
101103

104+
@property
105+
def channel(self):
106+
"""The gRPC channel used by the transport.
107+
108+
Returns:
109+
grpc.Channel: A gRPC channel object.
110+
"""
111+
return self._channel
112+
102113
@property
103114
def annotate_video(self):
104115
"""Return the gRPC stub for {$apiMethod.name}.

videointelligence/google/cloud/videointelligence_v1beta1/gapic/video_intelligence_service_client.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def __init__(self,
7373
transport=None,
7474
channel=None,
7575
credentials=None,
76-
client_config=video_intelligence_service_client_config.config,
76+
client_config=None,
7777
client_info=None):
7878
"""Constructor.
7979
@@ -106,13 +106,20 @@ def __init__(self,
106106
your own client library.
107107
"""
108108
# Raise deprecation warnings for things we want to go away.
109-
if client_config:
110-
warnings.warn('The `client_config` argument is deprecated.',
111-
PendingDeprecationWarning)
109+
if client_config is not None:
110+
warnings.warn(
111+
'The `client_config` argument is deprecated.',
112+
PendingDeprecationWarning,
113+
stacklevel=2)
114+
else:
115+
client_config = video_intelligence_service_client_config.config
116+
112117
if channel:
113118
warnings.warn(
114119
'The `channel` argument is deprecated; use '
115-
'`transport` instead.', PendingDeprecationWarning)
120+
'`transport` instead.',
121+
PendingDeprecationWarning,
122+
stacklevel=2)
116123

117124
# Instantiate the transport.
118125
# The transport is responsible for handling serialization and

videointelligence/google/cloud/videointelligence_v1beta2/gapic/transports/video_intelligence_service_grpc_transport.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ def __init__(self,
6363
credentials=credentials,
6464
)
6565

66+
self._channel = channel
67+
6668
# gRPC uses objects called "stubs" that are bound to the
6769
# channel and provide a basic method for each RPC.
6870
self._stubs = {
@@ -99,6 +101,15 @@ def create_channel(cls,
99101
scopes=cls._OAUTH_SCOPES,
100102
)
101103

104+
@property
105+
def channel(self):
106+
"""The gRPC channel used by the transport.
107+
108+
Returns:
109+
grpc.Channel: A gRPC channel object.
110+
"""
111+
return self._channel
112+
102113
@property
103114
def annotate_video(self):
104115
"""Return the gRPC stub for {$apiMethod.name}.

videointelligence/google/cloud/videointelligence_v1beta2/gapic/video_intelligence_service_client.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def __init__(self,
7373
transport=None,
7474
channel=None,
7575
credentials=None,
76-
client_config=video_intelligence_service_client_config.config,
76+
client_config=None,
7777
client_info=None):
7878
"""Constructor.
7979
@@ -106,13 +106,20 @@ def __init__(self,
106106
your own client library.
107107
"""
108108
# Raise deprecation warnings for things we want to go away.
109-
if client_config:
110-
warnings.warn('The `client_config` argument is deprecated.',
111-
PendingDeprecationWarning)
109+
if client_config is not None:
110+
warnings.warn(
111+
'The `client_config` argument is deprecated.',
112+
PendingDeprecationWarning,
113+
stacklevel=2)
114+
else:
115+
client_config = video_intelligence_service_client_config.config
116+
112117
if channel:
113118
warnings.warn(
114119
'The `channel` argument is deprecated; use '
115-
'`transport` instead.', PendingDeprecationWarning)
120+
'`transport` instead.',
121+
PendingDeprecationWarning,
122+
stacklevel=2)
116123

117124
# Instantiate the transport.
118125
# The transport is responsible for handling serialization and

videointelligence/google/cloud/videointelligence_v1p1beta1/gapic/transports/video_intelligence_service_grpc_transport.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ def __init__(self,
6363
credentials=credentials,
6464
)
6565

66+
self._channel = channel
67+
6668
# gRPC uses objects called "stubs" that are bound to the
6769
# channel and provide a basic method for each RPC.
6870
self._stubs = {
@@ -99,6 +101,15 @@ def create_channel(cls,
99101
scopes=cls._OAUTH_SCOPES,
100102
)
101103

104+
@property
105+
def channel(self):
106+
"""The gRPC channel used by the transport.
107+
108+
Returns:
109+
grpc.Channel: A gRPC channel object.
110+
"""
111+
return self._channel
112+
102113
@property
103114
def annotate_video(self):
104115
"""Return the gRPC stub for {$apiMethod.name}.

videointelligence/google/cloud/videointelligence_v1p1beta1/gapic/video_intelligence_service_client.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def __init__(self,
7373
transport=None,
7474
channel=None,
7575
credentials=None,
76-
client_config=video_intelligence_service_client_config.config,
76+
client_config=None,
7777
client_info=None):
7878
"""Constructor.
7979
@@ -106,13 +106,20 @@ def __init__(self,
106106
your own client library.
107107
"""
108108
# Raise deprecation warnings for things we want to go away.
109-
if client_config:
110-
warnings.warn('The `client_config` argument is deprecated.',
111-
PendingDeprecationWarning)
109+
if client_config is not None:
110+
warnings.warn(
111+
'The `client_config` argument is deprecated.',
112+
PendingDeprecationWarning,
113+
stacklevel=2)
114+
else:
115+
client_config = video_intelligence_service_client_config.config
116+
112117
if channel:
113118
warnings.warn(
114119
'The `channel` argument is deprecated; use '
115-
'`transport` instead.', PendingDeprecationWarning)
120+
'`transport` instead.',
121+
PendingDeprecationWarning,
122+
stacklevel=2)
116123

117124
# Instantiate the transport.
118125
# The transport is responsible for handling serialization and

videointelligence/google/cloud/videointelligence_v1p2beta1/gapic/transports/video_intelligence_service_grpc_transport.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ def __init__(self,
6363
credentials=credentials,
6464
)
6565

66+
self._channel = channel
67+
6668
# gRPC uses objects called "stubs" that are bound to the
6769
# channel and provide a basic method for each RPC.
6870
self._stubs = {
@@ -99,6 +101,15 @@ def create_channel(cls,
99101
scopes=cls._OAUTH_SCOPES,
100102
)
101103

104+
@property
105+
def channel(self):
106+
"""The gRPC channel used by the transport.
107+
108+
Returns:
109+
grpc.Channel: A gRPC channel object.
110+
"""
111+
return self._channel
112+
102113
@property
103114
def annotate_video(self):
104115
"""Return the gRPC stub for {$apiMethod.name}.

videointelligence/google/cloud/videointelligence_v1p2beta1/gapic/video_intelligence_service_client.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def __init__(self,
7373
transport=None,
7474
channel=None,
7575
credentials=None,
76-
client_config=video_intelligence_service_client_config.config,
76+
client_config=None,
7777
client_info=None):
7878
"""Constructor.
7979
@@ -106,13 +106,20 @@ def __init__(self,
106106
your own client library.
107107
"""
108108
# Raise deprecation warnings for things we want to go away.
109-
if client_config:
110-
warnings.warn('The `client_config` argument is deprecated.',
111-
PendingDeprecationWarning)
109+
if client_config is not None:
110+
warnings.warn(
111+
'The `client_config` argument is deprecated.',
112+
PendingDeprecationWarning,
113+
stacklevel=2)
114+
else:
115+
client_config = video_intelligence_service_client_config.config
116+
112117
if channel:
113118
warnings.warn(
114119
'The `channel` argument is deprecated; use '
115-
'`transport` instead.', PendingDeprecationWarning)
120+
'`transport` instead.',
121+
PendingDeprecationWarning,
122+
stacklevel=2)
116123

117124
# Instantiate the transport.
118125
# The transport is responsible for handling serialization and

0 commit comments

Comments
 (0)