Skip to content

Commit 222a224

Browse files
yoshi-automationtseaver
authored andcommitted
Pick up fixes in GAPIC generator. (#6491)
Includes fixes from these PRs: - googleapis/gapic-generator#2407 - googleapis/gapic-generator#2396
1 parent 636c168 commit 222a224

4 files changed

Lines changed: 155 additions & 84 deletions

File tree

bigquery_datatransfer/google/cloud/bigquery_datatransfer_v1/gapic/data_transfer_service_client.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def __init__(self,
120120
transport=None,
121121
channel=None,
122122
credentials=None,
123-
client_config=data_transfer_service_client_config.config,
123+
client_config=None,
124124
client_info=None):
125125
"""Constructor.
126126
@@ -153,13 +153,20 @@ def __init__(self,
153153
your own client library.
154154
"""
155155
# Raise deprecation warnings for things we want to go away.
156-
if client_config:
157-
warnings.warn('The `client_config` argument is deprecated.',
158-
PendingDeprecationWarning)
156+
if client_config is not None:
157+
warnings.warn(
158+
'The `client_config` argument is deprecated.',
159+
PendingDeprecationWarning,
160+
stacklevel=2)
161+
else:
162+
client_config = data_transfer_service_client_config.config
163+
159164
if channel:
160165
warnings.warn(
161166
'The `channel` argument is deprecated; use '
162-
'`transport` instead.', PendingDeprecationWarning)
167+
'`transport` instead.',
168+
PendingDeprecationWarning,
169+
stacklevel=2)
163170

164171
# Instantiate the transport.
165172
# The transport is responsible for handling serialization and

bigquery_datatransfer/google/cloud/bigquery_datatransfer_v1/gapic/enums.py

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,6 @@
1818
import enum
1919

2020

21-
class NullValue(enum.IntEnum):
22-
"""
23-
``NullValue`` is a singleton enumeration to represent the null value for
24-
the ``Value`` type union.
25-
26-
The JSON representation for ``NullValue`` is JSON ``null``.
27-
28-
Attributes:
29-
NULL_VALUE (int): Null value.
30-
"""
31-
NULL_VALUE = 0
32-
33-
3421
class TransferType(enum.IntEnum):
3522
"""
3623
DEPRECATED. Represents data transfer type.
@@ -67,21 +54,17 @@ class TransferState(enum.IntEnum):
6754
CANCELLED = 6
6855

6956

70-
class TransferMessage(object):
71-
class MessageSeverity(enum.IntEnum):
72-
"""
73-
Represents data transfer user facing message severity.
57+
class NullValue(enum.IntEnum):
58+
"""
59+
``NullValue`` is a singleton enumeration to represent the null value for
60+
the ``Value`` type union.
7461
75-
Attributes:
76-
MESSAGE_SEVERITY_UNSPECIFIED (int): No severity specified.
77-
INFO (int): Informational message.
78-
WARNING (int): Warning message.
79-
ERROR (int): Error message.
80-
"""
81-
MESSAGE_SEVERITY_UNSPECIFIED = 0
82-
INFO = 1
83-
WARNING = 2
84-
ERROR = 3
62+
The JSON representation for ``NullValue`` is JSON ``null``.
63+
64+
Attributes:
65+
NULL_VALUE (int): Null value.
66+
"""
67+
NULL_VALUE = 0
8568

8669

8770
class DataSourceParameter(object):
@@ -153,3 +136,20 @@ class RunAttempt(enum.IntEnum):
153136
"""
154137
RUN_ATTEMPT_UNSPECIFIED = 0
155138
LATEST = 1
139+
140+
141+
class TransferMessage(object):
142+
class MessageSeverity(enum.IntEnum):
143+
"""
144+
Represents data transfer user facing message severity.
145+
146+
Attributes:
147+
MESSAGE_SEVERITY_UNSPECIFIED (int): No severity specified.
148+
INFO (int): Informational message.
149+
WARNING (int): Warning message.
150+
ERROR (int): Error message.
151+
"""
152+
MESSAGE_SEVERITY_UNSPECIFIED = 0
153+
INFO = 1
154+
WARNING = 2
155+
ERROR = 3

bigquery_datatransfer/google/cloud/bigquery_datatransfer_v1/gapic/transports/data_transfer_service_grpc_transport.py

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

65+
self._channel = channel
66+
6567
# gRPC uses objects called "stubs" that are bound to the
6668
# channel and provide a basic method for each RPC.
6769
self._stubs = {
@@ -92,6 +94,15 @@ def create_channel(cls,
9294
scopes=cls._OAUTH_SCOPES,
9395
)
9496

97+
@property
98+
def channel(self):
99+
"""The gRPC channel used by the transport.
100+
101+
Returns:
102+
grpc.Channel: A gRPC channel object.
103+
"""
104+
return self._channel
105+
95106
@property
96107
def get_data_source(self):
97108
"""Return the gRPC stub for {$apiMethod.name}.

0 commit comments

Comments
 (0)