|
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.lifesciences_v2beta import gapic_version as package_version |
38 | 39 |
|
39 | 40 | try: |
40 | 41 | OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] |
@@ -225,7 +226,7 @@ async def run_pipeline( |
225 | 226 | request: Optional[Union[workflows.RunPipelineRequest, dict]] = None, |
226 | 227 | *, |
227 | 228 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
228 | | - timeout: Optional[float] = None, |
| 229 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
229 | 230 | metadata: Sequence[Tuple[str, str]] = (), |
230 | 231 | ) -> operation_async.AsyncOperation: |
231 | 232 | r"""Runs a pipeline. The returned Operation's [metadata] |
@@ -271,7 +272,7 @@ async def sample_run_pipeline(): |
271 | 272 |
|
272 | 273 | print("Waiting for operation to complete...") |
273 | 274 |
|
274 | | - response = await operation.result() |
| 275 | + response = (await operation).result() |
275 | 276 |
|
276 | 277 | # Handle the response |
277 | 278 | print(response) |
@@ -337,7 +338,7 @@ async def list_operations( |
337 | 338 | request: Optional[operations_pb2.ListOperationsRequest] = None, |
338 | 339 | *, |
339 | 340 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
340 | | - timeout: Optional[float] = None, |
| 341 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
341 | 342 | metadata: Sequence[Tuple[str, str]] = (), |
342 | 343 | ) -> operations_pb2.ListOperationsResponse: |
343 | 344 | r"""Lists operations that match the specified filter in the request. |
@@ -391,7 +392,7 @@ async def get_operation( |
391 | 392 | request: Optional[operations_pb2.GetOperationRequest] = None, |
392 | 393 | *, |
393 | 394 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
394 | | - timeout: Optional[float] = None, |
| 395 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
395 | 396 | metadata: Sequence[Tuple[str, str]] = (), |
396 | 397 | ) -> operations_pb2.Operation: |
397 | 398 | r"""Gets the latest state of a long-running operation. |
@@ -445,7 +446,7 @@ async def cancel_operation( |
445 | 446 | request: Optional[operations_pb2.CancelOperationRequest] = None, |
446 | 447 | *, |
447 | 448 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
448 | | - timeout: Optional[float] = None, |
| 449 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
449 | 450 | metadata: Sequence[Tuple[str, str]] = (), |
450 | 451 | ) -> None: |
451 | 452 | r"""Starts asynchronous cancellation on a long-running operation. |
@@ -499,7 +500,7 @@ async def get_location( |
499 | 500 | request: Optional[locations_pb2.GetLocationRequest] = None, |
500 | 501 | *, |
501 | 502 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
502 | | - timeout: Optional[float] = None, |
| 503 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
503 | 504 | metadata: Sequence[Tuple[str, str]] = (), |
504 | 505 | ) -> locations_pb2.Location: |
505 | 506 | r"""Gets information about a location. |
@@ -553,7 +554,7 @@ async def list_locations( |
553 | 554 | request: Optional[locations_pb2.ListLocationsRequest] = None, |
554 | 555 | *, |
555 | 556 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
556 | | - timeout: Optional[float] = None, |
| 557 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
557 | 558 | metadata: Sequence[Tuple[str, str]] = (), |
558 | 559 | ) -> locations_pb2.ListLocationsResponse: |
559 | 560 | r"""Lists information about the supported locations for this service. |
@@ -609,14 +610,9 @@ async def __aexit__(self, exc_type, exc, tb): |
609 | 610 | await self.transport.close() |
610 | 611 |
|
611 | 612 |
|
612 | | -try: |
613 | | - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( |
614 | | - gapic_version=pkg_resources.get_distribution( |
615 | | - "google-cloud-life-sciences", |
616 | | - ).version, |
617 | | - ) |
618 | | -except pkg_resources.DistributionNotFound: |
619 | | - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() |
| 613 | +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( |
| 614 | + gapic_version=package_version.__version__ |
| 615 | +) |
620 | 616 |
|
621 | 617 |
|
622 | 618 | __all__ = ("WorkflowsServiceV2BetaAsyncClient",) |
0 commit comments