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

Commit

Permalink
chore: use gapic-generator-python 0.53.4 (#43)
Browse files Browse the repository at this point in the history
- [ ] Regenerate this pull request now.

docs: list oneofs in docstring
fix(deps): require google-api-core >= 1.28.0
fix(deps): drop packaging dependency

committer: busunkim96@
PiperOrigin-RevId: 406468269

Source-Link: googleapis/googleapis@83d81b0

Source-Link: googleapis/googleapis-gen@2ff001f
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMmZmMDAxZmJhY2I5ZTc3ZTcxZDczNGRlNWY5NTVjMDVmZGFlODUyNiJ9
  • Loading branch information
gcf-owl-bot[bot] committed Nov 1, 2021
1 parent ad8706b commit 1ea0cb4
Show file tree
Hide file tree
Showing 10 changed files with 188 additions and 207 deletions.
130 changes: 66 additions & 64 deletions google/cloud/datastream_v1alpha1/services/datastream/async_client.py

Large diffs are not rendered by default.

44 changes: 23 additions & 21 deletions google/cloud/datastream_v1alpha1/services/datastream/client.py
Expand Up @@ -30,6 +30,8 @@
from google.auth.exceptions import MutualTLSChannelError # type: ignore
from google.oauth2 import service_account # type: ignore

OptionalRetry = Union[retries.Retry, object]

from google.api_core import operation # type: ignore
from google.api_core import operation_async # type: ignore
from google.cloud.datastream_v1alpha1.services.datastream import pagers
Expand Down Expand Up @@ -413,7 +415,7 @@ def list_connection_profiles(
request: Union[datastream.ListConnectionProfilesRequest, dict] = None,
*,
parent: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListConnectionProfilesPager:
Expand Down Expand Up @@ -491,7 +493,7 @@ def get_connection_profile(
request: Union[datastream.GetConnectionProfileRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> datastream_resources.ConnectionProfile:
Expand Down Expand Up @@ -562,7 +564,7 @@ def create_connection_profile(
parent: str = None,
connection_profile: datastream_resources.ConnectionProfile = None,
connection_profile_id: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation.Operation:
Expand Down Expand Up @@ -664,7 +666,7 @@ def update_connection_profile(
*,
connection_profile: datastream_resources.ConnectionProfile = None,
update_mask: field_mask_pb2.FieldMask = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation.Operation:
Expand Down Expand Up @@ -763,7 +765,7 @@ def delete_connection_profile(
request: Union[datastream.DeleteConnectionProfileRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation.Operation:
Expand Down Expand Up @@ -855,7 +857,7 @@ def discover_connection_profile(
self,
request: Union[datastream.DiscoverConnectionProfileRequest, dict] = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> datastream.DiscoverConnectionProfileResponse:
Expand Down Expand Up @@ -910,7 +912,7 @@ def list_streams(
request: Union[datastream.ListStreamsRequest, dict] = None,
*,
parent: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListStreamsPager:
Expand Down Expand Up @@ -988,7 +990,7 @@ def get_stream(
request: Union[datastream.GetStreamRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> datastream_resources.Stream:
Expand Down Expand Up @@ -1058,7 +1060,7 @@ def create_stream(
parent: str = None,
stream: datastream_resources.Stream = None,
stream_id: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation.Operation:
Expand Down Expand Up @@ -1155,7 +1157,7 @@ def update_stream(
*,
stream: datastream_resources.Stream = None,
update_mask: field_mask_pb2.FieldMask = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation.Operation:
Expand Down Expand Up @@ -1251,7 +1253,7 @@ def delete_stream(
request: Union[datastream.DeleteStreamRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation.Operation:
Expand Down Expand Up @@ -1341,7 +1343,7 @@ def fetch_errors(
self,
request: Union[datastream.FetchErrorsRequest, dict] = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation.Operation:
Expand Down Expand Up @@ -1404,7 +1406,7 @@ def fetch_static_ips(
request: Union[datastream.FetchStaticIpsRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.FetchStaticIpsPager:
Expand Down Expand Up @@ -1489,7 +1491,7 @@ def create_private_connection(
parent: str = None,
private_connection: datastream_resources.PrivateConnection = None,
private_connection_id: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation.Operation:
Expand Down Expand Up @@ -1590,7 +1592,7 @@ def get_private_connection(
request: Union[datastream.GetPrivateConnectionRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> datastream_resources.PrivateConnection:
Expand Down Expand Up @@ -1663,7 +1665,7 @@ def list_private_connections(
request: Union[datastream.ListPrivateConnectionsRequest, dict] = None,
*,
parent: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListPrivateConnectionsPager:
Expand Down Expand Up @@ -1742,7 +1744,7 @@ def delete_private_connection(
request: Union[datastream.DeletePrivateConnectionRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation.Operation:
Expand Down Expand Up @@ -1838,7 +1840,7 @@ def create_route(
parent: str = None,
route: datastream_resources.Route = None,
route_id: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation.Operation:
Expand Down Expand Up @@ -1936,7 +1938,7 @@ def get_route(
request: Union[datastream.GetRouteRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> datastream_resources.Route:
Expand Down Expand Up @@ -2008,7 +2010,7 @@ def list_routes(
request: Union[datastream.ListRoutesRequest, dict] = None,
*,
parent: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListRoutesPager:
Expand Down Expand Up @@ -2087,7 +2089,7 @@ def delete_route(
request: Union[datastream.DeleteRouteRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation.Operation:
Expand Down
Expand Up @@ -15,7 +15,6 @@
#
import abc
from typing import Awaitable, Callable, Dict, Optional, Sequence, Union
import packaging.version
import pkg_resources

import google.auth # type: ignore
Expand All @@ -40,15 +39,6 @@
except pkg_resources.DistributionNotFound:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()

try:
# google.auth.__version__ was added in 1.26.0
_GOOGLE_AUTH_VERSION = google.auth.__version__
except AttributeError:
try: # try pkg_resources if it is available
_GOOGLE_AUTH_VERSION = pkg_resources.get_distribution("google-auth").version
except pkg_resources.DistributionNotFound: # pragma: NO COVER
_GOOGLE_AUTH_VERSION = None


class DatastreamTransport(abc.ABC):
"""Abstract transport class for Datastream."""
Expand Down Expand Up @@ -98,7 +88,7 @@ def __init__(
host += ":443"
self._host = host

scopes_kwargs = self._get_scopes_kwargs(self._host, scopes)
scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}

# Save the scopes.
self._scopes = scopes
Expand Down Expand Up @@ -131,29 +121,6 @@ def __init__(
# Save the credentials.
self._credentials = credentials

# TODO(busunkim): This method is in the base transport
# to avoid duplicating code across the transport classes. These functions
# should be deleted once the minimum required versions of google-auth is increased.

# TODO: Remove this function once google-auth >= 1.25.0 is required
@classmethod
def _get_scopes_kwargs(
cls, host: str, scopes: Optional[Sequence[str]]
) -> Dict[str, Optional[Sequence[str]]]:
"""Returns scopes kwargs to pass to google-auth methods depending on the google-auth version"""

scopes_kwargs = {}

if _GOOGLE_AUTH_VERSION and (
packaging.version.parse(_GOOGLE_AUTH_VERSION)
>= packaging.version.parse("1.25.0")
):
scopes_kwargs = {"scopes": scopes, "default_scopes": cls.AUTH_SCOPES}
else:
scopes_kwargs = {"scopes": scopes or cls.AUTH_SCOPES}

return scopes_kwargs

def _prep_wrapped_messages(self, client_info):
# Precompute the wrapped methods.
self._wrapped_methods = {
Expand Down Expand Up @@ -252,7 +219,7 @@ def close(self):
raise NotImplementedError()

@property
def operations_client(self) -> operations_v1.OperationsClient:
def operations_client(self):
"""Return the client designed to process long-running operations."""
raise NotImplementedError()

Expand Down
Expand Up @@ -113,7 +113,7 @@ def __init__(
self._grpc_channel = None
self._ssl_channel_credentials = ssl_channel_credentials
self._stubs: Dict[str, Callable] = {}
self._operations_client = None
self._operations_client: Optional[operations_v1.OperationsClient] = None

if api_mtls_endpoint:
warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning)
Expand Down
Expand Up @@ -21,7 +21,6 @@
from google.api_core import operations_v1 # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore
import packaging.version

import grpc # type: ignore
from grpc.experimental import aio # type: ignore
Expand Down Expand Up @@ -160,7 +159,7 @@ def __init__(
self._grpc_channel = None
self._ssl_channel_credentials = ssl_channel_credentials
self._stubs: Dict[str, Callable] = {}
self._operations_client = None
self._operations_client: Optional[operations_v1.OperationsAsyncClient] = None

if api_mtls_endpoint:
warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning)
Expand Down
22 changes: 22 additions & 0 deletions google/cloud/datastream_v1alpha1/types/datastream.py
Expand Up @@ -59,27 +59,40 @@
class DiscoverConnectionProfileRequest(proto.Message):
r"""Request message for 'discover' ConnectionProfile request.
This message has `oneof`_ fields (mutually exclusive fields).
For each oneof, at most one member field can be set at the same time.
Setting any member of the oneof automatically clears all other
members.
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
Attributes:
parent (str):
Required. The parent resource of the ConnectionProfile type.
Must be in the format ``projects/*/locations/*``.
connection_profile (google.cloud.datastream_v1alpha1.types.ConnectionProfile):
An ad-hoc ConnectionProfile configuration.
This field is a member of `oneof`_ ``target``.
connection_profile_name (str):
A reference to an existing ConnectionProfile.
This field is a member of `oneof`_ ``target``.
recursive (bool):
Whether to retrieve the full hierarchy of
data objects (TRUE) or only the current level
(FALSE).
This field is a member of `oneof`_ ``depth``.
recursion_depth (int):
The number of hierarchy levels below the
current level to be retrieved.
This field is a member of `oneof`_ ``depth``.
oracle_rdbms (google.cloud.datastream_v1alpha1.types.OracleRdbms):
Oracle RDBMS to enrich with child data
objects and metadata.
This field is a member of `oneof`_ ``data_object``.
mysql_rdbms (google.cloud.datastream_v1alpha1.types.MysqlRdbms):
MySQL RDBMS to enrich with child data objects
and metadata.
This field is a member of `oneof`_ ``data_object``.
"""

parent = proto.Field(proto.STRING, number=1,)
Expand Down Expand Up @@ -109,11 +122,20 @@ class DiscoverConnectionProfileRequest(proto.Message):
class DiscoverConnectionProfileResponse(proto.Message):
r"""
This message has `oneof`_ fields (mutually exclusive fields).
For each oneof, at most one member field can be set at the same time.
Setting any member of the oneof automatically clears all other
members.
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
Attributes:
oracle_rdbms (google.cloud.datastream_v1alpha1.types.OracleRdbms):
Enriched Oracle RDBMS object.
This field is a member of `oneof`_ ``data_object``.
mysql_rdbms (google.cloud.datastream_v1alpha1.types.MysqlRdbms):
Enriched MySQL RDBMS object.
This field is a member of `oneof`_ ``data_object``.
"""

oracle_rdbms = proto.Field(
Expand Down

0 comments on commit 1ea0cb4

Please sign in to comment.