Skip to content
This repository was archived by the owner on Jul 6, 2023. It is now read-only.

Commit 89c426a

Browse files
chore: use gapic-generator-python 0.53.4 (#60)
- [ ] 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: https://github.com/googleapis/googleapis-gen/commit/2ff001fbacb9e77e71d734de5f955c05fdae8526 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMmZmMDAxZmJhY2I5ZTc3ZTcxZDczNGRlNWY5NTVjMDVmZGFlODUyNiJ9
1 parent 4c2a677 commit 89c426a

File tree

8 files changed

+40
-135
lines changed

8 files changed

+40
-135
lines changed

google/cloud/resourcesettings_v1/services/resource_settings_service/async_client.py

+12-10
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.resourcesettings_v1.services.resource_settings_service import pagers
3032
from google.cloud.resourcesettings_v1.types import resource_settings
3133
from .transports.base import ResourceSettingsServiceTransport, DEFAULT_CLIENT_INFO
@@ -181,18 +183,18 @@ def __init__(
181183

182184
async def list_settings(
183185
self,
184-
request: resource_settings.ListSettingsRequest = None,
186+
request: Union[resource_settings.ListSettingsRequest, dict] = None,
185187
*,
186188
parent: str = None,
187-
retry: retries.Retry = gapic_v1.method.DEFAULT,
189+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
188190
timeout: float = None,
189191
metadata: Sequence[Tuple[str, str]] = (),
190192
) -> pagers.ListSettingsAsyncPager:
191193
r"""Lists all the settings that are available on the Cloud resource
192194
``parent``.
193195
194196
Args:
195-
request (:class:`google.cloud.resourcesettings_v1.types.ListSettingsRequest`):
197+
request (Union[google.cloud.resourcesettings_v1.types.ListSettingsRequest, dict]):
196198
The request object. The request for ListSettings.
197199
parent (:class:`str`):
198200
Required. The Cloud resource that parents the setting.
@@ -275,10 +277,10 @@ async def list_settings(
275277

276278
async def get_setting(
277279
self,
278-
request: resource_settings.GetSettingRequest = None,
280+
request: Union[resource_settings.GetSettingRequest, dict] = None,
279281
*,
280282
name: str = None,
281-
retry: retries.Retry = gapic_v1.method.DEFAULT,
283+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
282284
timeout: float = None,
283285
metadata: Sequence[Tuple[str, str]] = (),
284286
) -> resource_settings.Setting:
@@ -288,7 +290,7 @@ async def get_setting(
288290
``google.rpc.Code.NOT_FOUND`` if the setting does not exist.
289291
290292
Args:
291-
request (:class:`google.cloud.resourcesettings_v1.types.GetSettingRequest`):
293+
request (Union[google.cloud.resourcesettings_v1.types.GetSettingRequest, dict]):
292294
The request object. The request for GetSetting.
293295
name (:class:`str`):
294296
Required. The name of the setting to get. See
@@ -357,9 +359,9 @@ async def get_setting(
357359

358360
async def update_setting(
359361
self,
360-
request: resource_settings.UpdateSettingRequest = None,
362+
request: Union[resource_settings.UpdateSettingRequest, dict] = None,
361363
*,
362-
retry: retries.Retry = gapic_v1.method.DEFAULT,
364+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
363365
timeout: float = None,
364366
metadata: Sequence[Tuple[str, str]] = (),
365367
) -> resource_settings.Setting:
@@ -381,7 +383,7 @@ async def update_setting(
381383
``local_value`` field.
382384
383385
Args:
384-
request (:class:`google.cloud.resourcesettings_v1.types.UpdateSettingRequest`):
386+
request (Union[google.cloud.resourcesettings_v1.types.UpdateSettingRequest, dict]):
385387
The request object. The request for UpdateSetting.
386388
retry (google.api_core.retry.Retry): Designation of what errors, if any,
387389
should be retried.

google/cloud/resourcesettings_v1/services/resource_settings_service/client.py

+5-3
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.resourcesettings_v1.services.resource_settings_service import pagers
3436
from google.cloud.resourcesettings_v1.types import resource_settings
3537
from .transports.base import ResourceSettingsServiceTransport, DEFAULT_CLIENT_INFO
@@ -366,7 +368,7 @@ def list_settings(
366368
request: Union[resource_settings.ListSettingsRequest, dict] = None,
367369
*,
368370
parent: str = None,
369-
retry: retries.Retry = gapic_v1.method.DEFAULT,
371+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
370372
timeout: float = None,
371373
metadata: Sequence[Tuple[str, str]] = (),
372374
) -> pagers.ListSettingsPager:
@@ -450,7 +452,7 @@ def get_setting(
450452
request: Union[resource_settings.GetSettingRequest, dict] = None,
451453
*,
452454
name: str = None,
453-
retry: retries.Retry = gapic_v1.method.DEFAULT,
455+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
454456
timeout: float = None,
455457
metadata: Sequence[Tuple[str, str]] = (),
456458
) -> resource_settings.Setting:
@@ -521,7 +523,7 @@ def update_setting(
521523
self,
522524
request: Union[resource_settings.UpdateSettingRequest, dict] = None,
523525
*,
524-
retry: retries.Retry = gapic_v1.method.DEFAULT,
526+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
525527
timeout: float = None,
526528
metadata: Sequence[Tuple[str, str]] = (),
527529
) -> resource_settings.Setting:

google/cloud/resourcesettings_v1/services/resource_settings_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 ResourceSettingsServiceTransport(abc.ABC):
5141
"""Abstract transport class for ResourceSettingsService."""
@@ -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 = {

google/cloud/resourcesettings_v1/services/resource_settings_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

google/cloud/resourcesettings_v1/types/resource_settings.py

+11
Original file line numberDiff line numberDiff line change
@@ -141,15 +141,26 @@ class DataType(proto.Enum):
141141
class Value(proto.Message):
142142
r"""The data in a setting value.
143143
144+
This message has `oneof`_ fields (mutually exclusive fields).
145+
For each oneof, at most one member field can be set at the same time.
146+
Setting any member of the oneof automatically clears all other
147+
members.
148+
149+
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
150+
144151
Attributes:
145152
boolean_value (bool):
146153
Defines this value as being a boolean value.
154+
This field is a member of `oneof`_ ``value``.
147155
string_value (str):
148156
Defines this value as being a string value.
157+
This field is a member of `oneof`_ ``value``.
149158
string_set_value (google.cloud.resourcesettings_v1.types.Value.StringSet):
150159
Defines this value as being a StringSet.
160+
This field is a member of `oneof`_ ``value``.
151161
enum_value (google.cloud.resourcesettings_v1.types.Value.EnumValue):
152162
Defines this value as being a Enum.
163+
This field is a member of `oneof`_ ``value``.
153164
"""
154165

155166
class StringSet(proto.Message):

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
# NOTE: Maintainers, please do not require google-api-core>=2.x.x
4545
# Until this issue is closed
4646
# https://github.com/googleapis/google-cloud-python/issues/10566
47-
"google-api-core[grpc] >= 1.26.0, <3.0.0dev",
47+
"google-api-core[grpc] >= 1.28.0, <3.0.0dev",
4848
"proto-plus >= 1.15.0",
4949
),
5050
python_requires=">=3.6",

testing/constraints-3.6.txt

+1-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22
# are correct in setup.py
33
# List all library dependencies and extras in this file.
44
# Pin the version to the lower bound.
5-
65
# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev",
76
# Then this file should have google-cloud-foo==1.14.0
8-
google-api-core==1.26.0
7+
google-api-core==1.28.0
98
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)