diff --git a/google/cloud/datastream_v1alpha1/services/datastream/async_client.py b/google/cloud/datastream_v1alpha1/services/datastream/async_client.py index 5c8f568..7615a82 100644 --- a/google/cloud/datastream_v1alpha1/services/datastream/async_client.py +++ b/google/cloud/datastream_v1alpha1/services/datastream/async_client.py @@ -19,13 +19,15 @@ from typing import Dict, Sequence, Tuple, Type, Union import pkg_resources -import google.api_core.client_options as ClientOptions # type: ignore +from google.api_core.client_options import ClientOptions # type: ignore from google.api_core import exceptions as core_exceptions # type: ignore from google.api_core import gapic_v1 # type: ignore from google.api_core import retry as retries # type: ignore from google.auth import credentials as ga_credentials # 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 @@ -173,10 +175,10 @@ def __init__( async def list_connection_profiles( self, - request: datastream.ListConnectionProfilesRequest = None, + 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.ListConnectionProfilesAsyncPager: @@ -184,7 +186,7 @@ async def list_connection_profiles( in a project and location. Args: - request (:class:`google.cloud.datastream_v1alpha1.types.ListConnectionProfilesRequest`): + request (Union[google.cloud.datastream_v1alpha1.types.ListConnectionProfilesRequest, dict]): The request object. parent (:class:`str`): Required. The parent that owns the @@ -251,10 +253,10 @@ async def list_connection_profiles( async def get_connection_profile( self, - request: datastream.GetConnectionProfileRequest = None, + 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: @@ -262,7 +264,7 @@ async def get_connection_profile( profile. Args: - request (:class:`google.cloud.datastream_v1alpha1.types.GetConnectionProfileRequest`): + request (Union[google.cloud.datastream_v1alpha1.types.GetConnectionProfileRequest, dict]): The request object. name (:class:`str`): Required. The name of the connection @@ -320,12 +322,12 @@ async def get_connection_profile( async def create_connection_profile( self, - request: datastream.CreateConnectionProfileRequest = None, + request: Union[datastream.CreateConnectionProfileRequest, dict] = None, *, 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_async.AsyncOperation: @@ -333,7 +335,7 @@ async def create_connection_profile( project and location. Args: - request (:class:`google.cloud.datastream_v1alpha1.types.CreateConnectionProfileRequest`): + request (Union[google.cloud.datastream_v1alpha1.types.CreateConnectionProfileRequest, dict]): The request object. parent (:class:`str`): Required. The parent that owns the @@ -421,11 +423,11 @@ async def create_connection_profile( async def update_connection_profile( self, - request: datastream.UpdateConnectionProfileRequest = None, + request: Union[datastream.UpdateConnectionProfileRequest, dict] = None, *, 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_async.AsyncOperation: @@ -433,7 +435,7 @@ async def update_connection_profile( connection profile. Args: - request (:class:`google.cloud.datastream_v1alpha1.types.UpdateConnectionProfileRequest`): + request (Union[google.cloud.datastream_v1alpha1.types.UpdateConnectionProfileRequest, dict]): The request object. connection_profile (:class:`google.cloud.datastream_v1alpha1.types.ConnectionProfile`): Required. The ConnectionProfile to @@ -519,17 +521,17 @@ async def update_connection_profile( async def delete_connection_profile( self, - request: datastream.DeleteConnectionProfileRequest = None, + 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_async.AsyncOperation: r"""Use this method to delete a connection profile.. Args: - request (:class:`google.cloud.datastream_v1alpha1.types.DeleteConnectionProfileRequest`): + request (Union[google.cloud.datastream_v1alpha1.types.DeleteConnectionProfileRequest, dict]): The request object. name (:class:`str`): Required. The name of the connection @@ -610,9 +612,9 @@ async def delete_connection_profile( async def discover_connection_profile( self, - request: datastream.DiscoverConnectionProfileRequest = None, + 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: @@ -623,7 +625,7 @@ async def discover_connection_profile( that's optionally supplied in the request. Args: - request (:class:`google.cloud.datastream_v1alpha1.types.DiscoverConnectionProfileRequest`): + request (Union[google.cloud.datastream_v1alpha1.types.DiscoverConnectionProfileRequest, dict]): The request object. Request message for 'discover' ConnectionProfile request. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -661,10 +663,10 @@ async def discover_connection_profile( async def list_streams( self, - request: datastream.ListStreamsRequest = None, + 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.ListStreamsAsyncPager: @@ -672,7 +674,7 @@ async def list_streams( location. Args: - request (:class:`google.cloud.datastream_v1alpha1.types.ListStreamsRequest`): + request (Union[google.cloud.datastream_v1alpha1.types.ListStreamsRequest, dict]): The request object. parent (:class:`str`): Required. The parent that owns the @@ -739,17 +741,17 @@ async def list_streams( async def get_stream( self, - request: datastream.GetStreamRequest = None, + 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: r"""Use this method to get details about a stream. Args: - request (:class:`google.cloud.datastream_v1alpha1.types.GetStreamRequest`): + request (Union[google.cloud.datastream_v1alpha1.types.GetStreamRequest, dict]): The request object. name (:class:`str`): Required. The name of the stream @@ -807,19 +809,19 @@ async def get_stream( async def create_stream( self, - request: datastream.CreateStreamRequest = None, + request: Union[datastream.CreateStreamRequest, dict] = None, *, 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_async.AsyncOperation: r"""Use this method to create a stream. Args: - request (:class:`google.cloud.datastream_v1alpha1.types.CreateStreamRequest`): + request (Union[google.cloud.datastream_v1alpha1.types.CreateStreamRequest, dict]): The request object. parent (:class:`str`): Required. The parent that owns the @@ -905,11 +907,11 @@ async def create_stream( async def update_stream( self, - request: datastream.UpdateStreamRequest = None, + request: Union[datastream.UpdateStreamRequest, dict] = None, *, 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_async.AsyncOperation: @@ -917,7 +919,7 @@ async def update_stream( stream. Args: - request (:class:`google.cloud.datastream_v1alpha1.types.UpdateStreamRequest`): + request (Union[google.cloud.datastream_v1alpha1.types.UpdateStreamRequest, dict]): The request object. stream (:class:`google.cloud.datastream_v1alpha1.types.Stream`): Required. The stream resource to @@ -1002,17 +1004,17 @@ async def update_stream( async def delete_stream( self, - request: datastream.DeleteStreamRequest = None, + 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_async.AsyncOperation: r"""Use this method to delete a stream. Args: - request (:class:`google.cloud.datastream_v1alpha1.types.DeleteStreamRequest`): + request (Union[google.cloud.datastream_v1alpha1.types.DeleteStreamRequest, dict]): The request object. name (:class:`str`): Required. The name of the stream @@ -1093,9 +1095,9 @@ async def delete_stream( async def fetch_errors( self, - request: datastream.FetchErrorsRequest = None, + 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_async.AsyncOperation: @@ -1103,7 +1105,7 @@ async def fetch_errors( stream. Args: - request (:class:`google.cloud.datastream_v1alpha1.types.FetchErrorsRequest`): + request (Union[google.cloud.datastream_v1alpha1.types.FetchErrorsRequest, dict]): The request object. Request message for 'FetchErrors' request. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -1154,10 +1156,10 @@ async def fetch_errors( async def fetch_static_ips( self, - request: datastream.FetchStaticIpsRequest = None, + 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.FetchStaticIpsAsyncPager: @@ -1167,7 +1169,7 @@ async def fetch_static_ips( optionally supplied in the request. Args: - request (:class:`google.cloud.datastream_v1alpha1.types.FetchStaticIpsRequest`): + request (Union[google.cloud.datastream_v1alpha1.types.FetchStaticIpsRequest, dict]): The request object. Request message for 'FetchStaticIps' request. name (:class:`str`): @@ -1237,12 +1239,12 @@ async def fetch_static_ips( async def create_private_connection( self, - request: datastream.CreatePrivateConnectionRequest = None, + request: Union[datastream.CreatePrivateConnectionRequest, dict] = None, *, 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_async.AsyncOperation: @@ -1250,7 +1252,7 @@ async def create_private_connection( configuration. Args: - request (:class:`google.cloud.datastream_v1alpha1.types.CreatePrivateConnectionRequest`): + request (Union[google.cloud.datastream_v1alpha1.types.CreatePrivateConnectionRequest, dict]): The request object. parent (:class:`str`): Required. The parent that owns the @@ -1338,10 +1340,10 @@ async def create_private_connection( async def get_private_connection( self, - request: datastream.GetPrivateConnectionRequest = None, + 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: @@ -1349,7 +1351,7 @@ async def get_private_connection( connectivity configuration. Args: - request (:class:`google.cloud.datastream_v1alpha1.types.GetPrivateConnectionRequest`): + request (Union[google.cloud.datastream_v1alpha1.types.GetPrivateConnectionRequest, dict]): The request object. name (:class:`str`): Required. The name of the private @@ -1411,10 +1413,10 @@ async def get_private_connection( async def list_private_connections( self, - request: datastream.ListPrivateConnectionsRequest = None, + 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.ListPrivateConnectionsAsyncPager: @@ -1422,7 +1424,7 @@ async def list_private_connections( configurations in a project and location. Args: - request (:class:`google.cloud.datastream_v1alpha1.types.ListPrivateConnectionsRequest`): + request (Union[google.cloud.datastream_v1alpha1.types.ListPrivateConnectionsRequest, dict]): The request object. parent (:class:`str`): Required. The parent that owns the @@ -1490,10 +1492,10 @@ async def list_private_connections( async def delete_private_connection( self, - request: datastream.DeletePrivateConnectionRequest = None, + 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_async.AsyncOperation: @@ -1501,7 +1503,7 @@ async def delete_private_connection( configuration. Args: - request (:class:`google.cloud.datastream_v1alpha1.types.DeletePrivateConnectionRequest`): + request (Union[google.cloud.datastream_v1alpha1.types.DeletePrivateConnectionRequest, dict]): The request object. name (:class:`str`): Required. The name of the private @@ -1582,12 +1584,12 @@ async def delete_private_connection( async def create_route( self, - request: datastream.CreateRouteRequest = None, + request: Union[datastream.CreateRouteRequest, dict] = None, *, 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_async.AsyncOperation: @@ -1595,7 +1597,7 @@ async def create_route( connectivity in a project and location. Args: - request (:class:`google.cloud.datastream_v1alpha1.types.CreateRouteRequest`): + request (Union[google.cloud.datastream_v1alpha1.types.CreateRouteRequest, dict]): The request object. route creation request parent (:class:`str`): Required. The parent that owns the @@ -1682,17 +1684,17 @@ async def create_route( async def get_route( self, - request: datastream.GetRouteRequest = None, + 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: r"""Use this method to get details about a route. Args: - request (:class:`google.cloud.datastream_v1alpha1.types.GetRouteRequest`): + request (Union[google.cloud.datastream_v1alpha1.types.GetRouteRequest, dict]): The request object. route get request name (:class:`str`): Required. The name of the Route @@ -1754,10 +1756,10 @@ async def get_route( async def list_routes( self, - request: datastream.ListRoutesRequest = None, + 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.ListRoutesAsyncPager: @@ -1765,7 +1767,7 @@ async def list_routes( connectivity in a project and location. Args: - request (:class:`google.cloud.datastream_v1alpha1.types.ListRoutesRequest`): + request (Union[google.cloud.datastream_v1alpha1.types.ListRoutesRequest, dict]): The request object. route list request parent (:class:`str`): Required. The parent that owns the @@ -1833,17 +1835,17 @@ async def list_routes( async def delete_route( self, - request: datastream.DeleteRouteRequest = None, + 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_async.AsyncOperation: r"""Use this method to delete a route. Args: - request (:class:`google.cloud.datastream_v1alpha1.types.DeleteRouteRequest`): + request (Union[google.cloud.datastream_v1alpha1.types.DeleteRouteRequest, dict]): The request object. route deletion request name (:class:`str`): Required. The name of the Route diff --git a/google/cloud/datastream_v1alpha1/services/datastream/client.py b/google/cloud/datastream_v1alpha1/services/datastream/client.py index 07af2d3..310b934 100644 --- a/google/cloud/datastream_v1alpha1/services/datastream/client.py +++ b/google/cloud/datastream_v1alpha1/services/datastream/client.py @@ -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 @@ -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: @@ -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: @@ -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: @@ -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: @@ -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: @@ -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: @@ -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: @@ -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: @@ -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: @@ -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: @@ -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: @@ -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: @@ -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: @@ -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: @@ -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: @@ -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: @@ -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: @@ -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: @@ -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: @@ -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: @@ -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: diff --git a/google/cloud/datastream_v1alpha1/services/datastream/transports/base.py b/google/cloud/datastream_v1alpha1/services/datastream/transports/base.py index e034088..10f7f7d 100644 --- a/google/cloud/datastream_v1alpha1/services/datastream/transports/base.py +++ b/google/cloud/datastream_v1alpha1/services/datastream/transports/base.py @@ -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 @@ -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.""" @@ -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 @@ -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 = { @@ -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() diff --git a/google/cloud/datastream_v1alpha1/services/datastream/transports/grpc.py b/google/cloud/datastream_v1alpha1/services/datastream/transports/grpc.py index dd7c92c..a3b97d4 100644 --- a/google/cloud/datastream_v1alpha1/services/datastream/transports/grpc.py +++ b/google/cloud/datastream_v1alpha1/services/datastream/transports/grpc.py @@ -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) diff --git a/google/cloud/datastream_v1alpha1/services/datastream/transports/grpc_asyncio.py b/google/cloud/datastream_v1alpha1/services/datastream/transports/grpc_asyncio.py index b2ee457..97a6d19 100644 --- a/google/cloud/datastream_v1alpha1/services/datastream/transports/grpc_asyncio.py +++ b/google/cloud/datastream_v1alpha1/services/datastream/transports/grpc_asyncio.py @@ -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 @@ -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) diff --git a/google/cloud/datastream_v1alpha1/types/datastream.py b/google/cloud/datastream_v1alpha1/types/datastream.py index 9992189..4fc46ba 100644 --- a/google/cloud/datastream_v1alpha1/types/datastream.py +++ b/google/cloud/datastream_v1alpha1/types/datastream.py @@ -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,) @@ -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( diff --git a/google/cloud/datastream_v1alpha1/types/datastream_resources.py b/google/cloud/datastream_v1alpha1/types/datastream_resources.py index 670d704..d5a0f25 100644 --- a/google/cloud/datastream_v1alpha1/types/datastream_resources.py +++ b/google/cloud/datastream_v1alpha1/types/datastream_resources.py @@ -155,6 +155,13 @@ class StaticServiceIpConnectivity(proto.Message): class ForwardSshTunnelConnectivity(proto.Message): r"""Forward SSH Tunnel connectivity. + 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: hostname (str): Required. Hostname for the SSH tunnel. @@ -164,8 +171,10 @@ class ForwardSshTunnelConnectivity(proto.Message): Port for the SSH tunnel, default value is 22. password (str): Input only. SSH password. + This field is a member of `oneof`_ ``authentication_method``. private_key (str): Input only. SSH private key. + This field is a member of `oneof`_ ``authentication_method``. """ hostname = proto.Field(proto.STRING, number=1,) @@ -317,6 +326,13 @@ class MysqlSslConfig(proto.Message): class ConnectionProfile(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: name (str): Output only. The resource's name. @@ -330,19 +346,26 @@ class ConnectionProfile(proto.Message): Required. Display name. oracle_profile (google.cloud.datastream_v1alpha1.types.OracleProfile): Oracle ConnectionProfile configuration. + This field is a member of `oneof`_ ``profile``. gcs_profile (google.cloud.datastream_v1alpha1.types.GcsProfile): Cloud Storage ConnectionProfile configuration. + This field is a member of `oneof`_ ``profile``. mysql_profile (google.cloud.datastream_v1alpha1.types.MysqlProfile): MySQL ConnectionProfile configuration. + This field is a member of `oneof`_ ``profile``. no_connectivity (google.cloud.datastream_v1alpha1.types.NoConnectivitySettings): No connectivity option chosen. + This field is a member of `oneof`_ ``connectivity``. static_service_ip_connectivity (google.cloud.datastream_v1alpha1.types.StaticServiceIpConnectivity): Static Service IP connectivity. + This field is a member of `oneof`_ ``connectivity``. forward_ssh_connectivity (google.cloud.datastream_v1alpha1.types.ForwardSshTunnelConnectivity): Forward SSH tunnel connectivity. + This field is a member of `oneof`_ ``connectivity``. private_connectivity (google.cloud.datastream_v1alpha1.types.PrivateConnectivity): Private connectivity. + This field is a member of `oneof`_ ``connectivity``. """ name = proto.Field(proto.STRING, number=1,) @@ -575,14 +598,23 @@ class MysqlSourceConfig(proto.Message): class SourceConfig(proto.Message): r"""The configuration of the stream source. + 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: source_connection_profile_name (str): Required. Source connection profile identifier. oracle_source_config (google.cloud.datastream_v1alpha1.types.OracleSourceConfig): Oracle data source configuration + This field is a member of `oneof`_ ``source_stream_config``. mysql_source_config (google.cloud.datastream_v1alpha1.types.MysqlSourceConfig): MySQL data source configuration + This field is a member of `oneof`_ ``source_stream_config``. """ source_connection_profile_name = proto.Field(proto.STRING, number=1,) @@ -628,6 +660,13 @@ class JsonCompression(proto.Enum): class GcsDestinationConfig(proto.Message): r"""Google Cloud Storage destination configuration + 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: path (str): Path inside the Cloud Storage bucket to write @@ -644,8 +683,10 @@ class GcsDestinationConfig(proto.Message): created. avro_file_format (google.cloud.datastream_v1alpha1.types.AvroFileFormat): AVRO file format configuration. + This field is a member of `oneof`_ ``file_format``. json_file_format (google.cloud.datastream_v1alpha1.types.JsonFileFormat): JSON file format configuration. + This field is a member of `oneof`_ ``file_format``. """ path = proto.Field(proto.STRING, number=1,) @@ -665,12 +706,15 @@ class GcsDestinationConfig(proto.Message): class DestinationConfig(proto.Message): r"""The configuration of the stream destination. + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + Attributes: destination_connection_profile_name (str): Required. Destination connection profile identifier. gcs_destination_config (google.cloud.datastream_v1alpha1.types.GcsDestinationConfig): + This field is a member of `oneof`_ ``destination_stream_config``. """ destination_connection_profile_name = proto.Field(proto.STRING, number=1,) @@ -685,6 +729,13 @@ class DestinationConfig(proto.Message): class Stream(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: name (str): Output only. The stream's name. @@ -709,8 +760,10 @@ class Stream(proto.Message): Automatically backfill objects included in the stream source configuration. Specific objects can be excluded. + This field is a member of `oneof`_ ``backfill_strategy``. backfill_none (google.cloud.datastream_v1alpha1.types.Stream.BackfillNoneStrategy): Do not automatically backfill any objects. + This field is a member of `oneof`_ ``backfill_strategy``. errors (Sequence[google.cloud.datastream_v1alpha1.types.Error]): Output only. Errors on the Stream. """ @@ -731,13 +784,22 @@ class BackfillAllStrategy(proto.Message): r"""Backfill strategy to automatically backfill the Stream's objects. Specific objects can be excluded. + 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_excluded_objects (google.cloud.datastream_v1alpha1.types.OracleRdbms): Oracle data source objects to avoid backfilling. + This field is a member of `oneof`_ ``excluded_objects``. mysql_excluded_objects (google.cloud.datastream_v1alpha1.types.MysqlRdbms): MySQL data source objects to avoid backfilling. + This field is a member of `oneof`_ ``excluded_objects``. """ oracle_excluded_objects = proto.Field( diff --git a/setup.py b/setup.py index 523d6d5..b23f9c2 100644 --- a/setup.py +++ b/setup.py @@ -29,9 +29,8 @@ # NOTE: Maintainers, please do not require google-api-core>=2.x.x # Until this issue is closed # https://github.com/googleapis/google-cloud-python/issues/10566 - "google-api-core[grpc] >= 1.26.0, <3.0.0dev", + "google-api-core[grpc] >= 1.28.0, <3.0.0dev", "proto-plus >= 1.15.0", - "packaging >= 14.3", ] package_root = os.path.abspath(os.path.dirname(__file__)) diff --git a/testing/constraints-3.6.txt b/testing/constraints-3.6.txt index fe11de2..1e3ec8b 100644 --- a/testing/constraints-3.6.txt +++ b/testing/constraints-3.6.txt @@ -4,7 +4,5 @@ # Pin the version to the lower bound. # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", # Then this file should have google-cloud-foo==1.14.0 -google-api-core==1.26.0 +google-api-core==1.28.0 proto-plus==1.15.0 -packaging==14.3 -google-auth==1.24.0 # TODO: remove when google-auth>=1.25.0 si transitively required through google-api-core \ No newline at end of file diff --git a/tests/unit/gapic/datastream_v1alpha1/test_datastream.py b/tests/unit/gapic/datastream_v1alpha1/test_datastream.py index 116b55e..efd3ae3 100644 --- a/tests/unit/gapic/datastream_v1alpha1/test_datastream.py +++ b/tests/unit/gapic/datastream_v1alpha1/test_datastream.py @@ -15,7 +15,6 @@ # import os import mock -import packaging.version import grpc from grpc.experimental import aio @@ -39,9 +38,6 @@ from google.cloud.datastream_v1alpha1.services.datastream import DatastreamClient from google.cloud.datastream_v1alpha1.services.datastream import pagers from google.cloud.datastream_v1alpha1.services.datastream import transports -from google.cloud.datastream_v1alpha1.services.datastream.transports.base import ( - _GOOGLE_AUTH_VERSION, -) from google.cloud.datastream_v1alpha1.types import datastream from google.cloud.datastream_v1alpha1.types import datastream_resources from google.longrunning import operations_pb2 @@ -52,20 +48,6 @@ import google.auth -# TODO(busunkim): Once google-auth >= 1.25.0 is required transitively -# through google-api-core: -# - Delete the auth "less than" test cases -# - Delete these pytest markers (Make the "greater than or equal to" tests the default). -requires_google_auth_lt_1_25_0 = pytest.mark.skipif( - packaging.version.parse(_GOOGLE_AUTH_VERSION) >= packaging.version.parse("1.25.0"), - reason="This test requires google-auth < 1.25.0", -) -requires_google_auth_gte_1_25_0 = pytest.mark.skipif( - packaging.version.parse(_GOOGLE_AUTH_VERSION) < packaging.version.parse("1.25.0"), - reason="This test requires google-auth >= 1.25.0", -) - - def client_cert_source_callback(): return b"cert bytes", b"key bytes" @@ -213,7 +195,7 @@ def test_datastream_client_client_options( options = client_options.ClientOptions(api_endpoint="squid.clam.whelk") with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None - client = client_class(client_options=options) + client = client_class(transport=transport_name, client_options=options) patched.assert_called_once_with( credentials=None, credentials_file=None, @@ -230,7 +212,7 @@ def test_datastream_client_client_options( with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None - client = client_class() + client = client_class(transport=transport_name) patched.assert_called_once_with( credentials=None, credentials_file=None, @@ -247,7 +229,7 @@ def test_datastream_client_client_options( with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None - client = client_class() + client = client_class(transport=transport_name) patched.assert_called_once_with( credentials=None, credentials_file=None, @@ -276,7 +258,7 @@ def test_datastream_client_client_options( options = client_options.ClientOptions(quota_project_id="octopus") with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None - client = client_class(client_options=options) + client = client_class(transport=transport_name, client_options=options) patched.assert_called_once_with( credentials=None, credentials_file=None, @@ -333,7 +315,7 @@ def test_datastream_client_mtls_env_auto( ) with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None - client = client_class(client_options=options) + client = client_class(transport=transport_name, client_options=options) if use_client_cert_env == "false": expected_client_cert_source = None @@ -375,7 +357,7 @@ def test_datastream_client_mtls_env_auto( expected_client_cert_source = client_cert_source_callback patched.return_value = None - client = client_class() + client = client_class(transport=transport_name) patched.assert_called_once_with( credentials=None, credentials_file=None, @@ -397,7 +379,7 @@ def test_datastream_client_mtls_env_auto( return_value=False, ): patched.return_value = None - client = client_class() + client = client_class(transport=transport_name) patched.assert_called_once_with( credentials=None, credentials_file=None, @@ -428,7 +410,7 @@ def test_datastream_client_client_options_scopes( options = client_options.ClientOptions(scopes=["1", "2"],) with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None - client = client_class(client_options=options) + client = client_class(transport=transport_name, client_options=options) patched.assert_called_once_with( credentials=None, credentials_file=None, @@ -459,7 +441,7 @@ def test_datastream_client_client_options_credentials_file( options = client_options.ClientOptions(credentials_file="credentials.json") with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None - client = client_class(client_options=options) + client = client_class(transport=transport_name, client_options=options) patched.assert_called_once_with( credentials=None, credentials_file="credentials.json", @@ -5696,7 +5678,6 @@ def test_datastream_base_transport(): transport.operations_client -@requires_google_auth_gte_1_25_0 def test_datastream_base_transport_with_credentials_file(): # Instantiate the base transport with a credentials file with mock.patch.object( @@ -5717,26 +5698,6 @@ def test_datastream_base_transport_with_credentials_file(): ) -@requires_google_auth_lt_1_25_0 -def test_datastream_base_transport_with_credentials_file_old_google_auth(): - # Instantiate the base transport with a credentials file - with mock.patch.object( - google.auth, "load_credentials_from_file", autospec=True - ) as load_creds, mock.patch( - "google.cloud.datastream_v1alpha1.services.datastream.transports.DatastreamTransport._prep_wrapped_messages" - ) as Transport: - Transport.return_value = None - load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) - transport = transports.DatastreamTransport( - credentials_file="credentials.json", quota_project_id="octopus", - ) - load_creds.assert_called_once_with( - "credentials.json", - scopes=("https://www.googleapis.com/auth/cloud-platform",), - quota_project_id="octopus", - ) - - def test_datastream_base_transport_with_adc(): # Test the default credentials are used if credentials and credentials_file are None. with mock.patch.object(google.auth, "default", autospec=True) as adc, mock.patch( @@ -5748,7 +5709,6 @@ def test_datastream_base_transport_with_adc(): adc.assert_called_once() -@requires_google_auth_gte_1_25_0 def test_datastream_auth_adc(): # If no credentials are provided, we should use ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: @@ -5761,23 +5721,10 @@ def test_datastream_auth_adc(): ) -@requires_google_auth_lt_1_25_0 -def test_datastream_auth_adc_old_google_auth(): - # If no credentials are provided, we should use ADC credentials. - with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (ga_credentials.AnonymousCredentials(), None) - DatastreamClient() - adc.assert_called_once_with( - scopes=("https://www.googleapis.com/auth/cloud-platform",), - quota_project_id=None, - ) - - @pytest.mark.parametrize( "transport_class", [transports.DatastreamGrpcTransport, transports.DatastreamGrpcAsyncIOTransport,], ) -@requires_google_auth_gte_1_25_0 def test_datastream_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use # ADC credentials. @@ -5791,23 +5738,6 @@ def test_datastream_transport_auth_adc(transport_class): ) -@pytest.mark.parametrize( - "transport_class", - [transports.DatastreamGrpcTransport, transports.DatastreamGrpcAsyncIOTransport,], -) -@requires_google_auth_lt_1_25_0 -def test_datastream_transport_auth_adc_old_google_auth(transport_class): - # If credentials and host are not provided, the transport class should use - # ADC credentials. - with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (ga_credentials.AnonymousCredentials(), None) - transport_class(quota_project_id="octopus") - adc.assert_called_once_with( - scopes=("https://www.googleapis.com/auth/cloud-platform",), - quota_project_id="octopus", - ) - - @pytest.mark.parametrize( "transport_class,grpc_helpers", [