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

Commit

Permalink
Pick up fixes in GAPIC generator. (#6491)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshi-automation authored and tseaver committed Nov 14, 2018
1 parent 6e3e7c8 commit 9bed1a1
Show file tree
Hide file tree
Showing 4 changed files with 155 additions and 84 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def __init__(self,
transport=None,
channel=None,
credentials=None,
client_config=data_transfer_service_client_config.config,
client_config=None,
client_info=None):
"""Constructor.
Expand Down Expand Up @@ -153,13 +153,20 @@ def __init__(self,
your own client library.
"""
# Raise deprecation warnings for things we want to go away.
if client_config:
warnings.warn('The `client_config` argument is deprecated.',
PendingDeprecationWarning)
if client_config is not None:
warnings.warn(
'The `client_config` argument is deprecated.',
PendingDeprecationWarning,
stacklevel=2)
else:
client_config = data_transfer_service_client_config.config

if channel:
warnings.warn(
'The `channel` argument is deprecated; use '
'`transport` instead.', PendingDeprecationWarning)
'`transport` instead.',
PendingDeprecationWarning,
stacklevel=2)

# Instantiate the transport.
# The transport is responsible for handling serialization and
Expand Down
54 changes: 27 additions & 27 deletions google/cloud/bigquery_datatransfer_v1/gapic/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,6 @@
import enum


class NullValue(enum.IntEnum):
"""
``NullValue`` is a singleton enumeration to represent the null value for
the ``Value`` type union.
The JSON representation for ``NullValue`` is JSON ``null``.
Attributes:
NULL_VALUE (int): Null value.
"""
NULL_VALUE = 0


class TransferType(enum.IntEnum):
"""
DEPRECATED. Represents data transfer type.
Expand Down Expand Up @@ -67,21 +54,17 @@ class TransferState(enum.IntEnum):
CANCELLED = 6


class TransferMessage(object):
class MessageSeverity(enum.IntEnum):
"""
Represents data transfer user facing message severity.
class NullValue(enum.IntEnum):
"""
``NullValue`` is a singleton enumeration to represent the null value for
the ``Value`` type union.
Attributes:
MESSAGE_SEVERITY_UNSPECIFIED (int): No severity specified.
INFO (int): Informational message.
WARNING (int): Warning message.
ERROR (int): Error message.
"""
MESSAGE_SEVERITY_UNSPECIFIED = 0
INFO = 1
WARNING = 2
ERROR = 3
The JSON representation for ``NullValue`` is JSON ``null``.
Attributes:
NULL_VALUE (int): Null value.
"""
NULL_VALUE = 0


class DataSourceParameter(object):
Expand Down Expand Up @@ -153,3 +136,20 @@ class RunAttempt(enum.IntEnum):
"""
RUN_ATTEMPT_UNSPECIFIED = 0
LATEST = 1


class TransferMessage(object):
class MessageSeverity(enum.IntEnum):
"""
Represents data transfer user facing message severity.
Attributes:
MESSAGE_SEVERITY_UNSPECIFIED (int): No severity specified.
INFO (int): Informational message.
WARNING (int): Warning message.
ERROR (int): Error message.
"""
MESSAGE_SEVERITY_UNSPECIFIED = 0
INFO = 1
WARNING = 2
ERROR = 3
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ def __init__(self,
credentials=credentials,
)

self._channel = channel

# gRPC uses objects called "stubs" that are bound to the
# channel and provide a basic method for each RPC.
self._stubs = {
Expand Down Expand Up @@ -92,6 +94,15 @@ def create_channel(cls,
scopes=cls._OAUTH_SCOPES,
)

@property
def channel(self):
"""The gRPC channel used by the transport.
Returns:
grpc.Channel: A gRPC channel object.
"""
return self._channel

@property
def get_data_source(self):
"""Return the gRPC stub for {$apiMethod.name}.
Expand Down
Loading

0 comments on commit 9bed1a1

Please sign in to comment.