|
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.trace_v1 import gapic_version as package_version |
38 | 39 |
|
39 | 40 | try: |
40 | 41 | OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] |
@@ -219,7 +220,7 @@ async def list_traces( |
219 | 220 | *, |
220 | 221 | project_id: Optional[str] = None, |
221 | 222 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
222 | | - timeout: Optional[float] = None, |
| 223 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
223 | 224 | metadata: Sequence[Tuple[str, str]] = (), |
224 | 225 | ) -> pagers.ListTracesAsyncPager: |
225 | 226 | r"""Returns of a list of traces that match the specified |
@@ -348,7 +349,7 @@ async def get_trace( |
348 | 349 | project_id: Optional[str] = None, |
349 | 350 | trace_id: Optional[str] = None, |
350 | 351 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
351 | | - timeout: Optional[float] = None, |
| 352 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
352 | 353 | metadata: Sequence[Tuple[str, str]] = (), |
353 | 354 | ) -> trace.Trace: |
354 | 355 | r"""Gets a single trace by its ID. |
@@ -477,7 +478,7 @@ async def patch_traces( |
477 | 478 | project_id: Optional[str] = None, |
478 | 479 | traces: Optional[trace.Traces] = None, |
479 | 480 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
480 | | - timeout: Optional[float] = None, |
| 481 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
481 | 482 | metadata: Sequence[Tuple[str, str]] = (), |
482 | 483 | ) -> None: |
483 | 484 | r"""Sends new traces to Stackdriver Trace or updates |
@@ -593,14 +594,9 @@ async def __aexit__(self, exc_type, exc, tb): |
593 | 594 | await self.transport.close() |
594 | 595 |
|
595 | 596 |
|
596 | | -try: |
597 | | - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( |
598 | | - gapic_version=pkg_resources.get_distribution( |
599 | | - "google-cloud-trace", |
600 | | - ).version, |
601 | | - ) |
602 | | -except pkg_resources.DistributionNotFound: |
603 | | - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() |
| 597 | +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( |
| 598 | + gapic_version=package_version.__version__ |
| 599 | +) |
604 | 600 |
|
605 | 601 |
|
606 | 602 | __all__ = ("TraceServiceAsyncClient",) |
0 commit comments