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

Commit

Permalink
fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#184)
Browse files Browse the repository at this point in the history
* fix(deps): Require google-api-core >=1.34.0, >=2.11.0

fix: Drop usage of pkg_resources

fix: Fix timeout default values

docs(samples): Snippetgen should call await on the operation coroutine before calling result

PiperOrigin-RevId: 493260409

Source-Link: googleapis/googleapis@fea4387

Source-Link: googleapis/googleapis-gen@387b734
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMzg3YjczNDRjNzUyOWVlNDRiZTg0ZTYxM2IxOWE4MjA1MDhjNjEyYiJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* add gapic_version.py

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
  • Loading branch information
3 people committed Dec 7, 2022
1 parent 91b157d commit dd3c0d7
Show file tree
Hide file tree
Showing 28 changed files with 156 additions and 153 deletions.
5 changes: 0 additions & 5 deletions .coveragerc
Expand Up @@ -10,8 +10,3 @@ exclude_lines =
pragma: NO COVER
# Ignore debug-only repr
def __repr__
# Ignore pkg_resources exceptions.
# This is added at the module level as a safeguard for if someone
# generates the code and tries to run it without pip installing. This
# makes it virtually impossible to test properly.
except pkg_resources.DistributionNotFound
16 changes: 16 additions & 0 deletions google/cloud/domains_v1/gapic_version.py
@@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "1.2.3" # {x-release-please-version}
60 changes: 28 additions & 32 deletions google/cloud/domains_v1/services/domains/async_client.py
Expand Up @@ -34,7 +34,8 @@
from google.api_core.client_options import ClientOptions
from google.auth import credentials as ga_credentials # type: ignore
from google.oauth2 import service_account # type: ignore
import pkg_resources

from google.cloud.domains_v1 import gapic_version as package_version

try:
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
Expand Down Expand Up @@ -221,7 +222,7 @@ async def search_domains(
location: Optional[str] = None,
query: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> domains.SearchDomainsResponse:
r"""Searches for available domain names similar to the provided
Expand Down Expand Up @@ -339,7 +340,7 @@ async def retrieve_register_parameters(
location: Optional[str] = None,
domain_name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> domains.RetrieveRegisterParametersResponse:
r"""Gets parameters needed to register a new domain name, including
Expand Down Expand Up @@ -454,7 +455,7 @@ async def register_domain(
registration: Optional[domains.Registration] = None,
yearly_price: Optional[money_pb2.Money] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation_async.AsyncOperation:
r"""Registers a new domain name and creates a corresponding
Expand Down Expand Up @@ -508,7 +509,7 @@ async def sample_register_domain():
print("Waiting for operation to complete...")
response = await operation.result()
response = (await operation).result()
# Handle the response
print(response)
Expand Down Expand Up @@ -638,7 +639,7 @@ async def retrieve_transfer_parameters(
location: Optional[str] = None,
domain_name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> domains.RetrieveTransferParametersResponse:
r"""Gets parameters needed to transfer a domain name from another
Expand Down Expand Up @@ -756,7 +757,7 @@ async def transfer_domain(
yearly_price: Optional[money_pb2.Money] = None,
authorization_code: Optional[domains.AuthorizationCode] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation_async.AsyncOperation:
r"""Transfers a domain name from another registrar to Cloud Domains.
Expand Down Expand Up @@ -820,7 +821,7 @@ async def sample_transfer_domain():
print("Waiting for operation to complete...")
response = await operation.result()
response = (await operation).result()
# Handle the response
print(response)
Expand Down Expand Up @@ -965,7 +966,7 @@ async def list_registrations(
*,
parent: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListRegistrationsAsyncPager:
r"""Lists the ``Registration`` resources in a project.
Expand Down Expand Up @@ -1080,7 +1081,7 @@ async def get_registration(
*,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> domains.Registration:
r"""Gets the details of a ``Registration`` resource.
Expand Down Expand Up @@ -1203,7 +1204,7 @@ async def update_registration(
registration: Optional[domains.Registration] = None,
update_mask: Optional[field_mask_pb2.FieldMask] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation_async.AsyncOperation:
r"""Updates select fields of a ``Registration`` resource, notably
Expand Down Expand Up @@ -1240,7 +1241,7 @@ async def sample_update_registration():
print("Waiting for operation to complete...")
response = await operation.result()
response = (await operation).result()
# Handle the response
print(response)
Expand Down Expand Up @@ -1361,7 +1362,7 @@ async def configure_management_settings(
management_settings: Optional[domains.ManagementSettings] = None,
update_mask: Optional[field_mask_pb2.FieldMask] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation_async.AsyncOperation:
r"""Updates a ``Registration``'s management settings.
Expand Down Expand Up @@ -1391,7 +1392,7 @@ async def sample_configure_management_settings():
print("Waiting for operation to complete...")
response = await operation.result()
response = (await operation).result()
# Handle the response
print(response)
Expand Down Expand Up @@ -1520,7 +1521,7 @@ async def configure_dns_settings(
dns_settings: Optional[domains.DnsSettings] = None,
update_mask: Optional[field_mask_pb2.FieldMask] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation_async.AsyncOperation:
r"""Updates a ``Registration``'s DNS settings.
Expand Down Expand Up @@ -1550,7 +1551,7 @@ async def sample_configure_dns_settings():
print("Waiting for operation to complete...")
response = await operation.result()
response = (await operation).result()
# Handle the response
print(response)
Expand Down Expand Up @@ -1686,7 +1687,7 @@ async def configure_contact_settings(
contact_settings: Optional[domains.ContactSettings] = None,
update_mask: Optional[field_mask_pb2.FieldMask] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation_async.AsyncOperation:
r"""Updates a ``Registration``'s contact settings. Some changes
Expand Down Expand Up @@ -1717,7 +1718,7 @@ async def sample_configure_contact_settings():
print("Waiting for operation to complete...")
response = await operation.result()
response = (await operation).result()
# Handle the response
print(response)
Expand Down Expand Up @@ -1844,7 +1845,7 @@ async def export_registration(
*,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation_async.AsyncOperation:
r"""Exports a ``Registration`` resource, such that it is no longer
Expand Down Expand Up @@ -1883,7 +1884,7 @@ async def sample_export_registration():
print("Waiting for operation to complete...")
response = await operation.result()
response = (await operation).result()
# Handle the response
print(response)
Expand Down Expand Up @@ -1989,7 +1990,7 @@ async def delete_registration(
*,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation_async.AsyncOperation:
r"""Deletes a ``Registration`` resource.
Expand Down Expand Up @@ -2040,7 +2041,7 @@ async def sample_delete_registration():
print("Waiting for operation to complete...")
response = await operation.result()
response = (await operation).result()
# Handle the response
print(response)
Expand Down Expand Up @@ -2134,7 +2135,7 @@ async def retrieve_authorization_code(
*,
registration: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> domains.AuthorizationCode:
r"""Gets the authorization code of the ``Registration`` for the
Expand Down Expand Up @@ -2241,7 +2242,7 @@ async def reset_authorization_code(
*,
registration: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> domains.AuthorizationCode:
r"""Resets the authorization code of the ``Registration`` to a new
Expand Down Expand Up @@ -2349,14 +2350,9 @@ async def __aexit__(self, exc_type, exc, tb):
await self.transport.close()


try:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=pkg_resources.get_distribution(
"google-cloud-domains",
).version,
)
except pkg_resources.DistributionNotFound:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=package_version.__version__
)


__all__ = ("DomainsAsyncClient",)

0 comments on commit dd3c0d7

Please sign in to comment.