Skip to content

Commit 9cc8996

Browse files
chore: use gapic-generator-python 0.53.4 (#85)
- [ ] 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 785f4d8 commit 9cc8996

File tree

16 files changed

+176
-361
lines changed

16 files changed

+176
-361
lines changed

packages/google-cloud-domains/google/cloud/domains_v1/services/domains/async_client.py

Lines changed: 48 additions & 46 deletions
Large diffs are not rendered by default.

packages/google-cloud-domains/google/cloud/domains_v1/services/domains/client.py

Lines changed: 17 additions & 15 deletions
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.api_core import operation # type: ignore
3436
from google.api_core import operation_async # type: ignore
3537
from google.cloud.domains_v1.services.domains import pagers
@@ -359,7 +361,7 @@ def search_domains(
359361
*,
360362
location: str = None,
361363
query: str = None,
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
) -> domains.SearchDomainsResponse:
@@ -443,7 +445,7 @@ def retrieve_register_parameters(
443445
*,
444446
location: str = None,
445447
domain_name: str = None,
446-
retry: retries.Retry = gapic_v1.method.DEFAULT,
448+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
447449
timeout: float = None,
448450
metadata: Sequence[Tuple[str, str]] = (),
449451
) -> domains.RetrieveRegisterParametersResponse:
@@ -528,7 +530,7 @@ def register_domain(
528530
parent: str = None,
529531
registration: domains.Registration = None,
530532
yearly_price: money_pb2.Money = None,
531-
retry: retries.Retry = gapic_v1.method.DEFAULT,
533+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
532534
timeout: float = None,
533535
metadata: Sequence[Tuple[str, str]] = (),
534536
) -> operation.Operation:
@@ -664,7 +666,7 @@ def retrieve_transfer_parameters(
664666
*,
665667
location: str = None,
666668
domain_name: str = None,
667-
retry: retries.Retry = gapic_v1.method.DEFAULT,
669+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
668670
timeout: float = None,
669671
metadata: Sequence[Tuple[str, str]] = (),
670672
) -> domains.RetrieveTransferParametersResponse:
@@ -752,7 +754,7 @@ def transfer_domain(
752754
registration: domains.Registration = None,
753755
yearly_price: money_pb2.Money = None,
754756
authorization_code: domains.AuthorizationCode = None,
755-
retry: retries.Retry = gapic_v1.method.DEFAULT,
757+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
756758
timeout: float = None,
757759
metadata: Sequence[Tuple[str, str]] = (),
758760
) -> operation.Operation:
@@ -915,7 +917,7 @@ def list_registrations(
915917
request: Union[domains.ListRegistrationsRequest, dict] = None,
916918
*,
917919
parent: str = None,
918-
retry: retries.Retry = gapic_v1.method.DEFAULT,
920+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
919921
timeout: float = None,
920922
metadata: Sequence[Tuple[str, str]] = (),
921923
) -> pagers.ListRegistrationsPager:
@@ -995,7 +997,7 @@ def get_registration(
995997
request: Union[domains.GetRegistrationRequest, dict] = None,
996998
*,
997999
name: str = None,
998-
retry: retries.Retry = gapic_v1.method.DEFAULT,
1000+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
9991001
timeout: float = None,
10001002
metadata: Sequence[Tuple[str, str]] = (),
10011003
) -> domains.Registration:
@@ -1087,7 +1089,7 @@ def update_registration(
10871089
*,
10881090
registration: domains.Registration = None,
10891091
update_mask: field_mask_pb2.FieldMask = None,
1090-
retry: retries.Retry = gapic_v1.method.DEFAULT,
1092+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
10911093
timeout: float = None,
10921094
metadata: Sequence[Tuple[str, str]] = (),
10931095
) -> operation.Operation:
@@ -1209,7 +1211,7 @@ def configure_management_settings(
12091211
registration: str = None,
12101212
management_settings: domains.ManagementSettings = None,
12111213
update_mask: field_mask_pb2.FieldMask = None,
1212-
retry: retries.Retry = gapic_v1.method.DEFAULT,
1214+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
12131215
timeout: float = None,
12141216
metadata: Sequence[Tuple[str, str]] = (),
12151217
) -> operation.Operation:
@@ -1335,7 +1337,7 @@ def configure_dns_settings(
13351337
registration: str = None,
13361338
dns_settings: domains.DnsSettings = None,
13371339
update_mask: field_mask_pb2.FieldMask = None,
1338-
retry: retries.Retry = gapic_v1.method.DEFAULT,
1340+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
13391341
timeout: float = None,
13401342
metadata: Sequence[Tuple[str, str]] = (),
13411343
) -> operation.Operation:
@@ -1466,7 +1468,7 @@ def configure_contact_settings(
14661468
registration: str = None,
14671469
contact_settings: domains.ContactSettings = None,
14681470
update_mask: field_mask_pb2.FieldMask = None,
1469-
retry: retries.Retry = gapic_v1.method.DEFAULT,
1471+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
14701472
timeout: float = None,
14711473
metadata: Sequence[Tuple[str, str]] = (),
14721474
) -> operation.Operation:
@@ -1591,7 +1593,7 @@ def export_registration(
15911593
request: Union[domains.ExportRegistrationRequest, dict] = None,
15921594
*,
15931595
name: str = None,
1594-
retry: retries.Retry = gapic_v1.method.DEFAULT,
1596+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
15951597
timeout: float = None,
15961598
metadata: Sequence[Tuple[str, str]] = (),
15971599
) -> operation.Operation:
@@ -1701,7 +1703,7 @@ def delete_registration(
17011703
request: Union[domains.DeleteRegistrationRequest, dict] = None,
17021704
*,
17031705
name: str = None,
1704-
retry: retries.Retry = gapic_v1.method.DEFAULT,
1706+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
17051707
timeout: float = None,
17061708
metadata: Sequence[Tuple[str, str]] = (),
17071709
) -> operation.Operation:
@@ -1814,7 +1816,7 @@ def retrieve_authorization_code(
18141816
request: Union[domains.RetrieveAuthorizationCodeRequest, dict] = None,
18151817
*,
18161818
registration: str = None,
1817-
retry: retries.Retry = gapic_v1.method.DEFAULT,
1819+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
18181820
timeout: float = None,
18191821
metadata: Sequence[Tuple[str, str]] = (),
18201822
) -> domains.AuthorizationCode:
@@ -1892,7 +1894,7 @@ def reset_authorization_code(
18921894
request: Union[domains.ResetAuthorizationCodeRequest, dict] = None,
18931895
*,
18941896
registration: str = None,
1895-
retry: retries.Retry = gapic_v1.method.DEFAULT,
1897+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
18961898
timeout: float = None,
18971899
metadata: Sequence[Tuple[str, str]] = (),
18981900
) -> domains.AuthorizationCode:

packages/google-cloud-domains/google/cloud/domains_v1/services/domains/transports/base.py

Lines changed: 2 additions & 35 deletions
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 DomainsTransport(abc.ABC):
5141
"""Abstract transport class for Domains."""
@@ -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 = {
@@ -225,7 +192,7 @@ def close(self):
225192
raise NotImplementedError()
226193

227194
@property
228-
def operations_client(self) -> operations_v1.OperationsClient:
195+
def operations_client(self):
229196
"""Return the client designed to process long-running operations."""
230197
raise NotImplementedError()
231198

packages/google-cloud-domains/google/cloud/domains_v1/services/domains/transports/grpc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def __init__(
113113
self._grpc_channel = None
114114
self._ssl_channel_credentials = ssl_channel_credentials
115115
self._stubs: Dict[str, Callable] = {}
116-
self._operations_client = None
116+
self._operations_client: Optional[operations_v1.OperationsClient] = None
117117

118118
if api_mtls_endpoint:
119119
warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning)

packages/google-cloud-domains/google/cloud/domains_v1/services/domains/transports/grpc_asyncio.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
from google.api_core import operations_v1 # type: ignore
2222
from google.auth import credentials as ga_credentials # type: ignore
2323
from google.auth.transport.grpc import SslCredentials # type: ignore
24-
import packaging.version
2524

2625
import grpc # type: ignore
2726
from grpc.experimental import aio # type: ignore
@@ -160,7 +159,7 @@ def __init__(
160159
self._grpc_channel = None
161160
self._ssl_channel_credentials = ssl_channel_credentials
162161
self._stubs: Dict[str, Callable] = {}
163-
self._operations_client = None
162+
self._operations_client: Optional[operations_v1.OperationsAsyncClient] = None
164163

165164
if api_mtls_endpoint:
166165
warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning)

packages/google-cloud-domains/google/cloud/domains_v1/types/domains.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,22 @@ class DnsSettings(proto.Message):
231231
r"""Defines the DNS configuration of a ``Registration``, including name
232232
servers, DNSSEC, and glue records.
233233
234+
This message has `oneof`_ fields (mutually exclusive fields).
235+
For each oneof, at most one member field can be set at the same time.
236+
Setting any member of the oneof automatically clears all other
237+
members.
238+
239+
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
240+
234241
Attributes:
235242
custom_dns (google.cloud.domains_v1.types.DnsSettings.CustomDns):
236243
An arbitrary DNS provider identified by its
237244
name servers.
245+
This field is a member of `oneof`_ ``dns_provider``.
238246
google_domains_dns (google.cloud.domains_v1.types.DnsSettings.GoogleDomainsDns):
239247
The free DNS zone provided by `Google
240248
Domains <https://domains.google/>`__.
249+
This field is a member of `oneof`_ ``dns_provider``.
241250
glue_records (Sequence[google.cloud.domains_v1.types.DnsSettings.GlueRecord]):
242251
The list of glue records for this ``Registration``. Commonly
243252
empty.

0 commit comments

Comments
 (0)