|
34 | 34 | from google.api_core.client_options import ClientOptions |
35 | 35 | from google.auth import credentials as ga_credentials # type: ignore |
36 | 36 | from google.oauth2 import service_account # type: ignore |
37 | | -import pkg_resources |
| 37 | + |
| 38 | +from google.cloud.ids_v1 import gapic_version as package_version |
38 | 39 |
|
39 | 40 | try: |
40 | 41 | OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] |
@@ -214,7 +215,7 @@ async def list_endpoints( |
214 | 215 | *, |
215 | 216 | parent: Optional[str] = None, |
216 | 217 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
217 | | - timeout: Optional[float] = None, |
| 218 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
218 | 219 | metadata: Sequence[Tuple[str, str]] = (), |
219 | 220 | ) -> pagers.ListEndpointsAsyncPager: |
220 | 221 | r"""Lists Endpoints in a given project and location. |
@@ -335,7 +336,7 @@ async def get_endpoint( |
335 | 336 | *, |
336 | 337 | name: Optional[str] = None, |
337 | 338 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
338 | | - timeout: Optional[float] = None, |
| 339 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
339 | 340 | metadata: Sequence[Tuple[str, str]] = (), |
340 | 341 | ) -> ids.Endpoint: |
341 | 342 | r"""Gets details of a single Endpoint. |
@@ -449,7 +450,7 @@ async def create_endpoint( |
449 | 450 | endpoint: Optional[ids.Endpoint] = None, |
450 | 451 | endpoint_id: Optional[str] = None, |
451 | 452 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
452 | | - timeout: Optional[float] = None, |
| 453 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
453 | 454 | metadata: Sequence[Tuple[str, str]] = (), |
454 | 455 | ) -> operation_async.AsyncOperation: |
455 | 456 | r"""Creates a new Endpoint in a given project and |
@@ -486,7 +487,7 @@ async def sample_create_endpoint(): |
486 | 487 |
|
487 | 488 | print("Waiting for operation to complete...") |
488 | 489 |
|
489 | | - response = await operation.result() |
| 490 | + response = (await operation).result() |
490 | 491 |
|
491 | 492 | # Handle the response |
492 | 493 | print(response) |
@@ -589,7 +590,7 @@ async def delete_endpoint( |
589 | 590 | *, |
590 | 591 | name: Optional[str] = None, |
591 | 592 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
592 | | - timeout: Optional[float] = None, |
| 593 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
593 | 594 | metadata: Sequence[Tuple[str, str]] = (), |
594 | 595 | ) -> operation_async.AsyncOperation: |
595 | 596 | r"""Deletes a single Endpoint. |
@@ -619,7 +620,7 @@ async def sample_delete_endpoint(): |
619 | 620 |
|
620 | 621 | print("Waiting for operation to complete...") |
621 | 622 |
|
622 | | - response = await operation.result() |
| 623 | + response = (await operation).result() |
623 | 624 |
|
624 | 625 | # Handle the response |
625 | 626 | print(response) |
@@ -713,14 +714,9 @@ async def __aexit__(self, exc_type, exc, tb): |
713 | 714 | await self.transport.close() |
714 | 715 |
|
715 | 716 |
|
716 | | -try: |
717 | | - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( |
718 | | - gapic_version=pkg_resources.get_distribution( |
719 | | - "google-cloud-ids", |
720 | | - ).version, |
721 | | - ) |
722 | | -except pkg_resources.DistributionNotFound: |
723 | | - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() |
| 717 | +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( |
| 718 | + gapic_version=package_version.__version__ |
| 719 | +) |
724 | 720 |
|
725 | 721 |
|
726 | 722 | __all__ = ("IDSAsyncClient",) |
0 commit comments