| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 785f4d8 commit 9cc8996
16 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -30,6 +30,8 @@ | |||
| 30 | 30 | from google.auth.exceptions import MutualTLSChannelError # type: ignore | |
| 31 | 31 | from google.oauth2 import service_account # type: ignore | |
| 32 | 32 | ||
| 33 | + OptionalRetry = Union[retries.Retry, object] | ||
| 34 | + | ||
| 33 | 35 | from google.api_core import operation # type: ignore | |
| 34 | 36 | from google.api_core import operation_async # type: ignore | |
| 35 | 37 | from google.cloud.domains_v1.services.domains import pagers | |
@@ -359,7 +361,7 @@ def search_domains( | |||
| 359 | 361 | *, | |
| 360 | 362 | location: str = None, | |
| 361 | 363 | query: str = None, | |
| 362 | - retry: retries.Retry = gapic_v1.method.DEFAULT, | ||
| 364 | + retry: OptionalRetry = gapic_v1.method.DEFAULT, | ||
| 363 | 365 | timeout: float = None, | |
| 364 | 366 | metadata: Sequence[Tuple[str, str]] = (), | |
| 365 | 367 | ) -> domains.SearchDomainsResponse: | |
@@ -443,7 +445,7 @@ def retrieve_register_parameters( | |||
| 443 | 445 | *, | |
| 444 | 446 | location: str = None, | |
| 445 | 447 | domain_name: str = None, | |
| 446 | - retry: retries.Retry = gapic_v1.method.DEFAULT, | ||
| 448 | + retry: OptionalRetry = gapic_v1.method.DEFAULT, | ||
| 447 | 449 | timeout: float = None, | |
| 448 | 450 | metadata: Sequence[Tuple[str, str]] = (), | |
| 449 | 451 | ) -> domains.RetrieveRegisterParametersResponse: | |
@@ -528,7 +530,7 @@ def register_domain( | |||
| 528 | 530 | parent: str = None, | |
| 529 | 531 | registration: domains.Registration = None, | |
| 530 | 532 | yearly_price: money_pb2.Money = None, | |
| 531 | - retry: retries.Retry = gapic_v1.method.DEFAULT, | ||
| 533 | + retry: OptionalRetry = gapic_v1.method.DEFAULT, | ||
| 532 | 534 | timeout: float = None, | |
| 533 | 535 | metadata: Sequence[Tuple[str, str]] = (), | |
| 534 | 536 | ) -> operation.Operation: | |
@@ -664,7 +666,7 @@ def retrieve_transfer_parameters( | |||
| 664 | 666 | *, | |
| 665 | 667 | location: str = None, | |
| 666 | 668 | domain_name: str = None, | |
| 667 | - retry: retries.Retry = gapic_v1.method.DEFAULT, | ||
| 669 | + retry: OptionalRetry = gapic_v1.method.DEFAULT, | ||
| 668 | 670 | timeout: float = None, | |
| 669 | 671 | metadata: Sequence[Tuple[str, str]] = (), | |
| 670 | 672 | ) -> domains.RetrieveTransferParametersResponse: | |
@@ -752,7 +754,7 @@ def transfer_domain( | |||
| 752 | 754 | registration: domains.Registration = None, | |
| 753 | 755 | yearly_price: money_pb2.Money = None, | |
| 754 | 756 | authorization_code: domains.AuthorizationCode = None, | |
| 755 | - retry: retries.Retry = gapic_v1.method.DEFAULT, | ||
| 757 | + retry: OptionalRetry = gapic_v1.method.DEFAULT, | ||
| 756 | 758 | timeout: float = None, | |
| 757 | 759 | metadata: Sequence[Tuple[str, str]] = (), | |
| 758 | 760 | ) -> operation.Operation: | |
@@ -915,7 +917,7 @@ def list_registrations( | |||
| 915 | 917 | request: Union[domains.ListRegistrationsRequest, dict] = None, | |
| 916 | 918 | *, | |
| 917 | 919 | parent: str = None, | |
| 918 | - retry: retries.Retry = gapic_v1.method.DEFAULT, | ||
| 920 | + retry: OptionalRetry = gapic_v1.method.DEFAULT, | ||
| 919 | 921 | timeout: float = None, | |
| 920 | 922 | metadata: Sequence[Tuple[str, str]] = (), | |
| 921 | 923 | ) -> pagers.ListRegistrationsPager: | |
@@ -995,7 +997,7 @@ def get_registration( | |||
| 995 | 997 | request: Union[domains.GetRegistrationRequest, dict] = None, | |
| 996 | 998 | *, | |
| 997 | 999 | name: str = None, | |
| 998 | - retry: retries.Retry = gapic_v1.method.DEFAULT, | ||
| 1000 | + retry: OptionalRetry = gapic_v1.method.DEFAULT, | ||
| 999 | 1001 | timeout: float = None, | |
| 1000 | 1002 | metadata: Sequence[Tuple[str, str]] = (), | |
| 1001 | 1003 | ) -> domains.Registration: | |
@@ -1087,7 +1089,7 @@ def update_registration( | |||
| 1087 | 1089 | *, | |
| 1088 | 1090 | registration: domains.Registration = None, | |
| 1089 | 1091 | update_mask: field_mask_pb2.FieldMask = None, | |
| 1090 | - retry: retries.Retry = gapic_v1.method.DEFAULT, | ||
| 1092 | + retry: OptionalRetry = gapic_v1.method.DEFAULT, | ||
| 1091 | 1093 | timeout: float = None, | |
| 1092 | 1094 | metadata: Sequence[Tuple[str, str]] = (), | |
| 1093 | 1095 | ) -> operation.Operation: | |
@@ -1209,7 +1211,7 @@ def configure_management_settings( | |||
| 1209 | 1211 | registration: str = None, | |
| 1210 | 1212 | management_settings: domains.ManagementSettings = None, | |
| 1211 | 1213 | update_mask: field_mask_pb2.FieldMask = None, | |
| 1212 | - retry: retries.Retry = gapic_v1.method.DEFAULT, | ||
| 1214 | + retry: OptionalRetry = gapic_v1.method.DEFAULT, | ||
| 1213 | 1215 | timeout: float = None, | |
| 1214 | 1216 | metadata: Sequence[Tuple[str, str]] = (), | |
| 1215 | 1217 | ) -> operation.Operation: | |
@@ -1335,7 +1337,7 @@ def configure_dns_settings( | |||
| 1335 | 1337 | registration: str = None, | |
| 1336 | 1338 | dns_settings: domains.DnsSettings = None, | |
| 1337 | 1339 | update_mask: field_mask_pb2.FieldMask = None, | |
| 1338 | - retry: retries.Retry = gapic_v1.method.DEFAULT, | ||
| 1340 | + retry: OptionalRetry = gapic_v1.method.DEFAULT, | ||
| 1339 | 1341 | timeout: float = None, | |
| 1340 | 1342 | metadata: Sequence[Tuple[str, str]] = (), | |
| 1341 | 1343 | ) -> operation.Operation: | |
@@ -1466,7 +1468,7 @@ def configure_contact_settings( | |||
| 1466 | 1468 | registration: str = None, | |
| 1467 | 1469 | contact_settings: domains.ContactSettings = None, | |
| 1468 | 1470 | update_mask: field_mask_pb2.FieldMask = None, | |
| 1469 | - retry: retries.Retry = gapic_v1.method.DEFAULT, | ||
| 1471 | + retry: OptionalRetry = gapic_v1.method.DEFAULT, | ||
| 1470 | 1472 | timeout: float = None, | |
| 1471 | 1473 | metadata: Sequence[Tuple[str, str]] = (), | |
| 1472 | 1474 | ) -> operation.Operation: | |
@@ -1591,7 +1593,7 @@ def export_registration( | |||
| 1591 | 1593 | request: Union[domains.ExportRegistrationRequest, dict] = None, | |
| 1592 | 1594 | *, | |
| 1593 | 1595 | name: str = None, | |
| 1594 | - retry: retries.Retry = gapic_v1.method.DEFAULT, | ||
| 1596 | + retry: OptionalRetry = gapic_v1.method.DEFAULT, | ||
| 1595 | 1597 | timeout: float = None, | |
| 1596 | 1598 | metadata: Sequence[Tuple[str, str]] = (), | |
| 1597 | 1599 | ) -> operation.Operation: | |
@@ -1701,7 +1703,7 @@ def delete_registration( | |||
| 1701 | 1703 | request: Union[domains.DeleteRegistrationRequest, dict] = None, | |
| 1702 | 1704 | *, | |
| 1703 | 1705 | name: str = None, | |
| 1704 | - retry: retries.Retry = gapic_v1.method.DEFAULT, | ||
| 1706 | + retry: OptionalRetry = gapic_v1.method.DEFAULT, | ||
| 1705 | 1707 | timeout: float = None, | |
| 1706 | 1708 | metadata: Sequence[Tuple[str, str]] = (), | |
| 1707 | 1709 | ) -> operation.Operation: | |
@@ -1814,7 +1816,7 @@ def retrieve_authorization_code( | |||
| 1814 | 1816 | request: Union[domains.RetrieveAuthorizationCodeRequest, dict] = None, | |
| 1815 | 1817 | *, | |
| 1816 | 1818 | registration: str = None, | |
| 1817 | - retry: retries.Retry = gapic_v1.method.DEFAULT, | ||
| 1819 | + retry: OptionalRetry = gapic_v1.method.DEFAULT, | ||
| 1818 | 1820 | timeout: float = None, | |
| 1819 | 1821 | metadata: Sequence[Tuple[str, str]] = (), | |
| 1820 | 1822 | ) -> domains.AuthorizationCode: | |
@@ -1892,7 +1894,7 @@ def reset_authorization_code( | |||
| 1892 | 1894 | request: Union[domains.ResetAuthorizationCodeRequest, dict] = None, | |
| 1893 | 1895 | *, | |
| 1894 | 1896 | registration: str = None, | |
| 1895 | - retry: retries.Retry = gapic_v1.method.DEFAULT, | ||
| 1897 | + retry: OptionalRetry = gapic_v1.method.DEFAULT, | ||
| 1896 | 1898 | timeout: float = None, | |
| 1897 | 1899 | metadata: Sequence[Tuple[str, str]] = (), | |
| 1898 | 1900 | ) -> domains.AuthorizationCode: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -15,7 +15,6 @@ | |||
| 15 | 15 | # | |
| 16 | 16 | import abc | |
| 17 | 17 | from typing import Awaitable, Callable, Dict, Optional, Sequence, Union | |
| 18 | - import packaging.version | ||
| 19 | 18 | import pkg_resources | |
| 20 | 19 | ||
| 21 | 20 | import google.auth # type: ignore | |
@@ -37,15 +36,6 @@ | |||
| 37 | 36 | except pkg_resources.DistributionNotFound: | |
| 38 | 37 | DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() | |
| 39 | 38 | ||
| 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 | - | ||
| 49 | 39 | ||
| 50 | 40 | class DomainsTransport(abc.ABC): | |
| 51 | 41 | """Abstract transport class for Domains.""" | |
@@ -95,7 +85,7 @@ def __init__( | |||
| 95 | 85 | host += ":443" | |
| 96 | 86 | self._host = host | |
| 97 | 87 | ||
| 98 | - scopes_kwargs = self._get_scopes_kwargs(self._host, scopes) | ||
| 88 | + scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} | ||
| 99 | 89 | ||
| 100 | 90 | # Save the scopes. | |
| 101 | 91 | self._scopes = scopes | |
@@ -128,29 +118,6 @@ def __init__( | |||
| 128 | 118 | # Save the credentials. | |
| 129 | 119 | self._credentials = credentials | |
| 130 | 120 | ||
| 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 | - | ||
| 154 | 121 | def _prep_wrapped_messages(self, client_info): | |
| 155 | 122 | # Precompute the wrapped methods. | |
| 156 | 123 | self._wrapped_methods = { | |
@@ -225,7 +192,7 @@ def close(self): | |||
| 225 | 192 | raise NotImplementedError() | |
| 226 | 193 | ||
| 227 | 194 | @property | |
| 228 | - def operations_client(self) -> operations_v1.OperationsClient: | ||
| 195 | + def operations_client(self): | ||
| 229 | 196 | """Return the client designed to process long-running operations.""" | |
| 230 | 197 | raise NotImplementedError() | |
| 231 | 198 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -113,7 +113,7 @@ def __init__( | |||
| 113 | 113 | self._grpc_channel = None | |
| 114 | 114 | self._ssl_channel_credentials = ssl_channel_credentials | |
| 115 | 115 | self._stubs: Dict[str, Callable] = {} | |
| 116 | - self._operations_client = None | ||
| 116 | + self._operations_client: Optional[operations_v1.OperationsClient] = None | ||
| 117 | 117 | ||
| 118 | 118 | if api_mtls_endpoint: | |
| 119 | 119 | warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,7 +21,6 @@ | |||
| 21 | 21 | from google.api_core import operations_v1 # type: ignore | |
| 22 | 22 | from google.auth import credentials as ga_credentials # type: ignore | |
| 23 | 23 | from google.auth.transport.grpc import SslCredentials # type: ignore | |
| 24 | - import packaging.version | ||
| 25 | 24 | ||
| 26 | 25 | import grpc # type: ignore | |
| 27 | 26 | from grpc.experimental import aio # type: ignore | |
@@ -160,7 +159,7 @@ def __init__( | |||
| 160 | 159 | self._grpc_channel = None | |
| 161 | 160 | self._ssl_channel_credentials = ssl_channel_credentials | |
| 162 | 161 | self._stubs: Dict[str, Callable] = {} | |
| 163 | - self._operations_client = None | ||
| 162 | + self._operations_client: Optional[operations_v1.OperationsAsyncClient] = None | ||
| 164 | 163 | ||
| 165 | 164 | if api_mtls_endpoint: | |
| 166 | 165 | warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -231,13 +231,22 @@ class DnsSettings(proto.Message): | |||
| 231 | 231 | r"""Defines the DNS configuration of a ``Registration``, including name | |
| 232 | 232 | servers, DNSSEC, and glue records. | |
| 233 | 233 | ||
| 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 | + | ||
| 234 | 241 | Attributes: | |
| 235 | 242 | custom_dns (google.cloud.domains_v1.types.DnsSettings.CustomDns): | |
| 236 | 243 | An arbitrary DNS provider identified by its | |
| 237 | 244 | name servers. | |
| 245 | + This field is a member of `oneof`_ ``dns_provider``. | ||
| 238 | 246 | google_domains_dns (google.cloud.domains_v1.types.DnsSettings.GoogleDomainsDns): | |
| 239 | 247 | The free DNS zone provided by `Google | |
| 240 | 248 | Domains <https://domains.google/>`__. | |
| 249 | + This field is a member of `oneof`_ ``dns_provider``. | ||
| 241 | 250 | glue_records (Sequence[google.cloud.domains_v1.types.DnsSettings.GlueRecord]): | |
| 242 | 251 | The list of glue records for this ``Registration``. Commonly | |
| 243 | 252 | empty. | |
| Back | FazBrowse Home | New Git URL |
0 commit comments