Skip to content

Commit 3b622ff

Browse files
chore: use gapic-generator-python 0.53.4 (#62)
- [ ] 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
1 parent 56b9f34 commit 3b622ff

File tree

13 files changed

+48
-244
lines changed

13 files changed

+48
-244
lines changed

packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/services/connection_service/async_client.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@
1919
from typing import Dict, Sequence, Tuple, Type, Union
2020
import pkg_resources
2121

22-
import google.api_core.client_options as ClientOptions # type: ignore
22+
from google.api_core.client_options import ClientOptions # type: ignore
2323
from google.api_core import exceptions as core_exceptions # type: ignore
2424
from google.api_core import gapic_v1 # type: ignore
2525
from google.api_core import retry as retries # type: ignore
2626
from google.auth import credentials as ga_credentials # type: ignore
2727
from google.oauth2 import service_account # type: ignore
2828

29+
OptionalRetry = Union[retries.Retry, object]
30+
2931
from google.cloud.apigeeconnect_v1.services.connection_service import pagers
3032
from google.cloud.apigeeconnect_v1.types import connection
3133
from .transports.base import ConnectionServiceTransport, DEFAULT_CLIENT_INFO
@@ -165,18 +167,18 @@ def __init__(
165167

166168
async def list_connections(
167169
self,
168-
request: connection.ListConnectionsRequest = None,
170+
request: Union[connection.ListConnectionsRequest, dict] = None,
169171
*,
170172
parent: str = None,
171-
retry: retries.Retry = gapic_v1.method.DEFAULT,
173+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
172174
timeout: float = None,
173175
metadata: Sequence[Tuple[str, str]] = (),
174176
) -> pagers.ListConnectionsAsyncPager:
175177
r"""Lists connections that are currently active for the
176178
given Apigee Connect endpoint.
177179
178180
Args:
179-
request (:class:`google.cloud.apigeeconnect_v1.types.ListConnectionsRequest`):
181+
request (Union[google.cloud.apigeeconnect_v1.types.ListConnectionsRequest, dict]):
180182
The request object. The request for
181183
[ListConnections][Management.ListConnections].
182184
parent (:class:`str`):

packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/services/connection_service/client.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
from google.auth.exceptions import MutualTLSChannelError # type: ignore
3131
from google.oauth2 import service_account # type: ignore
3232

33+
OptionalRetry = Union[retries.Retry, object]
34+
3335
from google.cloud.apigeeconnect_v1.services.connection_service import pagers
3436
from google.cloud.apigeeconnect_v1.types import connection
3537
from .transports.base import ConnectionServiceTransport, DEFAULT_CLIENT_INFO
@@ -353,7 +355,7 @@ def list_connections(
353355
request: Union[connection.ListConnectionsRequest, dict] = None,
354356
*,
355357
parent: str = None,
356-
retry: retries.Retry = gapic_v1.method.DEFAULT,
358+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
357359
timeout: float = None,
358360
metadata: Sequence[Tuple[str, str]] = (),
359361
) -> pagers.ListConnectionsPager:

packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/services/connection_service/transports/base.py

+1-34
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#
1616
import abc
1717
from typing import Awaitable, Callable, Dict, Optional, Sequence, Union
18-
import packaging.version
1918
import pkg_resources
2019

2120
import google.auth # type: ignore
@@ -37,15 +36,6 @@
3736
except pkg_resources.DistributionNotFound:
3837
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
3938

40-
try:
41-
# google.auth.__version__ was added in 1.26.0
42-
_GOOGLE_AUTH_VERSION = google.auth.__version__
43-
except AttributeError:
44-
try: # try pkg_resources if it is available
45-
_GOOGLE_AUTH_VERSION = pkg_resources.get_distribution("google-auth").version
46-
except pkg_resources.DistributionNotFound: # pragma: NO COVER
47-
_GOOGLE_AUTH_VERSION = None
48-
4939

5040
class ConnectionServiceTransport(abc.ABC):
5141
"""Abstract transport class for ConnectionService."""
@@ -95,7 +85,7 @@ def __init__(
9585
host += ":443"
9686
self._host = host
9787

98-
scopes_kwargs = self._get_scopes_kwargs(self._host, scopes)
88+
scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}
9989

10090
# Save the scopes.
10191
self._scopes = scopes
@@ -128,29 +118,6 @@ def __init__(
128118
# Save the credentials.
129119
self._credentials = credentials
130120

131-
# TODO(busunkim): This method is in the base transport
132-
# to avoid duplicating code across the transport classes. These functions
133-
# should be deleted once the minimum required versions of google-auth is increased.
134-
135-
# TODO: Remove this function once google-auth >= 1.25.0 is required
136-
@classmethod
137-
def _get_scopes_kwargs(
138-
cls, host: str, scopes: Optional[Sequence[str]]
139-
) -> Dict[str, Optional[Sequence[str]]]:
140-
"""Returns scopes kwargs to pass to google-auth methods depending on the google-auth version"""
141-
142-
scopes_kwargs = {}
143-
144-
if _GOOGLE_AUTH_VERSION and (
145-
packaging.version.parse(_GOOGLE_AUTH_VERSION)
146-
>= packaging.version.parse("1.25.0")
147-
):
148-
scopes_kwargs = {"scopes": scopes, "default_scopes": cls.AUTH_SCOPES}
149-
else:
150-
scopes_kwargs = {"scopes": scopes or cls.AUTH_SCOPES}
151-
152-
return scopes_kwargs
153-
154121
def _prep_wrapped_messages(self, client_info):
155122
# Precompute the wrapped methods.
156123
self._wrapped_methods = {

packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/services/connection_service/transports/grpc_asyncio.py

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
from google.api_core import grpc_helpers_async # type: ignore
2121
from google.auth import credentials as ga_credentials # type: ignore
2222
from google.auth.transport.grpc import SslCredentials # type: ignore
23-
import packaging.version
2423

2524
import grpc # type: ignore
2625
from grpc.experimental import aio # type: ignore

packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/services/tether/async_client.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,15 @@
2828
)
2929
import pkg_resources
3030

31-
import google.api_core.client_options as ClientOptions # type: ignore
31+
from google.api_core.client_options import ClientOptions # type: ignore
3232
from google.api_core import exceptions as core_exceptions # type: ignore
3333
from google.api_core import gapic_v1 # type: ignore
3434
from google.api_core import retry as retries # type: ignore
3535
from google.auth import credentials as ga_credentials # type: ignore
3636
from google.oauth2 import service_account # type: ignore
3737

38+
OptionalRetry = Union[retries.Retry, object]
39+
3840
from google.cloud.apigeeconnect_v1.types import tether
3941
from google.protobuf import duration_pb2 # type: ignore
4042
from .transports.base import TetherTransport, DEFAULT_CLIENT_INFO
@@ -166,7 +168,7 @@ def egress(
166168
self,
167169
requests: AsyncIterator[tether.EgressResponse] = None,
168170
*,
169-
retry: retries.Retry = gapic_v1.method.DEFAULT,
171+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
170172
timeout: float = None,
171173
metadata: Sequence[Tuple[str, str]] = (),
172174
) -> Awaitable[AsyncIterable[tether.EgressRequest]]:

packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/services/tether/client.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
from google.auth.exceptions import MutualTLSChannelError # type: ignore
3131
from google.oauth2 import service_account # type: ignore
3232

33+
OptionalRetry = Union[retries.Retry, object]
34+
3335
from google.cloud.apigeeconnect_v1.types import tether
3436
from google.protobuf import duration_pb2 # type: ignore
3537
from .transports.base import TetherTransport, DEFAULT_CLIENT_INFO
@@ -337,7 +339,7 @@ def egress(
337339
self,
338340
requests: Iterator[tether.EgressResponse] = None,
339341
*,
340-
retry: retries.Retry = gapic_v1.method.DEFAULT,
342+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
341343
timeout: float = None,
342344
metadata: Sequence[Tuple[str, str]] = (),
343345
) -> Iterable[tether.EgressRequest]:

packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/services/tether/transports/base.py

+1-34
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#
1616
import abc
1717
from typing import Awaitable, Callable, Dict, Optional, Sequence, Union
18-
import packaging.version
1918
import pkg_resources
2019

2120
import google.auth # type: ignore
@@ -37,15 +36,6 @@
3736
except pkg_resources.DistributionNotFound:
3837
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
3938

40-
try:
41-
# google.auth.__version__ was added in 1.26.0
42-
_GOOGLE_AUTH_VERSION = google.auth.__version__
43-
except AttributeError:
44-
try: # try pkg_resources if it is available
45-
_GOOGLE_AUTH_VERSION = pkg_resources.get_distribution("google-auth").version
46-
except pkg_resources.DistributionNotFound: # pragma: NO COVER
47-
_GOOGLE_AUTH_VERSION = None
48-
4939

5040
class TetherTransport(abc.ABC):
5141
"""Abstract transport class for Tether."""
@@ -95,7 +85,7 @@ def __init__(
9585
host += ":443"
9686
self._host = host
9787

98-
scopes_kwargs = self._get_scopes_kwargs(self._host, scopes)
88+
scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}
9989

10090
# Save the scopes.
10191
self._scopes = scopes
@@ -128,29 +118,6 @@ def __init__(
128118
# Save the credentials.
129119
self._credentials = credentials
130120

131-
# TODO(busunkim): This method is in the base transport
132-
# to avoid duplicating code across the transport classes. These functions
133-
# should be deleted once the minimum required versions of google-auth is increased.
134-
135-
# TODO: Remove this function once google-auth >= 1.25.0 is required
136-
@classmethod
137-
def _get_scopes_kwargs(
138-
cls, host: str, scopes: Optional[Sequence[str]]
139-
) -> Dict[str, Optional[Sequence[str]]]:
140-
"""Returns scopes kwargs to pass to google-auth methods depending on the google-auth version"""
141-
142-
scopes_kwargs = {}
143-
144-
if _GOOGLE_AUTH_VERSION and (
145-
packaging.version.parse(_GOOGLE_AUTH_VERSION)
146-
>= packaging.version.parse("1.25.0")
147-
):
148-
scopes_kwargs = {"scopes": scopes, "default_scopes": cls.AUTH_SCOPES}
149-
else:
150-
scopes_kwargs = {"scopes": scopes or cls.AUTH_SCOPES}
151-
152-
return scopes_kwargs
153-
154121
def _prep_wrapped_messages(self, client_info):
155122
# Precompute the wrapped methods.
156123
self._wrapped_methods = {

packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/services/tether/transports/grpc_asyncio.py

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
from google.api_core import grpc_helpers_async # type: ignore
2121
from google.auth import credentials as ga_credentials # type: ignore
2222
from google.auth.transport.grpc import SslCredentials # type: ignore
23-
import packaging.version
2423

2524
import grpc # type: ignore
2625
from grpc.experimental import aio # type: ignore

packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/types/tether.py

+10
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,23 @@ class EgressRequest(proto.Message):
8787
class Payload(proto.Message):
8888
r"""Payload for EgressRequest.
8989
90+
This message has `oneof`_ fields (mutually exclusive fields).
91+
For each oneof, at most one member field can be set at the same time.
92+
Setting any member of the oneof automatically clears all other
93+
members.
94+
95+
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
96+
9097
Attributes:
9198
http_request (google.cloud.apigeeconnect_v1.types.HttpRequest):
9299
The HttpRequest proto.
100+
This field is a member of `oneof`_ ``kind``.
93101
stream_info (google.cloud.apigeeconnect_v1.types.StreamInfo):
94102
The information of stream.
103+
This field is a member of `oneof`_ ``kind``.
95104
action (google.cloud.apigeeconnect_v1.types.Action):
96105
The action taken by agent.
106+
This field is a member of `oneof`_ ``kind``.
97107
"""
98108

99109
http_request = proto.Field(

packages/google-cloud-apigee-connect/setup.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@
2929
# NOTE: Maintainers, please do not require google-api-core>=2.x.x
3030
# Until this issue is closed
3131
# https://github.com/googleapis/google-cloud-python/issues/10566
32-
"google-api-core[grpc] >= 1.26.0, <3.0.0dev",
32+
"google-api-core[grpc] >= 1.28.0, <3.0.0dev",
3333
"proto-plus >= 1.15.0",
34-
"packaging >= 14.3",
3534
]
3635

3736
package_root = os.path.abspath(os.path.dirname(__file__))

packages/google-cloud-apigee-connect/testing/constraints-3.6.txt

+1-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,5 @@
55
#
66
# e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev",
77
# Then this file should have foo==1.14.0
8-
google-api-core==1.26.0
8+
google-api-core==1.28.0
99
proto-plus==1.15.0
10-
packaging==14.3
11-
google-auth==1.24.0 # TODO: remove when google-auth>=1.25.0 is transitively required through google-auth

0 commit comments

Comments
 (0)