|
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.dataplex_v1 import gapic_version as package_version |
38 | 39 |
|
39 | 40 | try: |
40 | 41 | OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] |
@@ -231,7 +232,7 @@ async def create_content( |
231 | 232 | parent: Optional[str] = None, |
232 | 233 | content: Optional[analyze.Content] = None, |
233 | 234 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
234 | | - timeout: Optional[float] = None, |
| 235 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
235 | 236 | metadata: Sequence[Tuple[str, str]] = (), |
236 | 237 | ) -> analyze.Content: |
237 | 238 | r"""Create a content. |
@@ -346,7 +347,7 @@ async def update_content( |
346 | 347 | content: Optional[analyze.Content] = None, |
347 | 348 | update_mask: Optional[field_mask_pb2.FieldMask] = None, |
348 | 349 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
349 | | - timeout: Optional[float] = None, |
| 350 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
350 | 351 | metadata: Sequence[Tuple[str, str]] = (), |
351 | 352 | ) -> analyze.Content: |
352 | 353 | r"""Update a content. Only supports full resource update. |
@@ -461,7 +462,7 @@ async def delete_content( |
461 | 462 | *, |
462 | 463 | name: Optional[str] = None, |
463 | 464 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
464 | | - timeout: Optional[float] = None, |
| 465 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
465 | 466 | metadata: Sequence[Tuple[str, str]] = (), |
466 | 467 | ) -> None: |
467 | 468 | r"""Delete a content. |
@@ -550,7 +551,7 @@ async def get_content( |
550 | 551 | *, |
551 | 552 | name: Optional[str] = None, |
552 | 553 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
553 | | - timeout: Optional[float] = None, |
| 554 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
554 | 555 | metadata: Sequence[Tuple[str, str]] = (), |
555 | 556 | ) -> analyze.Content: |
556 | 557 | r"""Get a content resource. |
@@ -660,7 +661,7 @@ async def get_iam_policy( |
660 | 661 | *, |
661 | 662 | resource: Optional[str] = None, |
662 | 663 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
663 | | - timeout: Optional[float] = None, |
| 664 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
664 | 665 | metadata: Sequence[Tuple[str, str]] = (), |
665 | 666 | ) -> policy_pb2.Policy: |
666 | 667 | r"""Gets the access control policy for a contentitem resource. A |
@@ -840,7 +841,7 @@ async def set_iam_policy( |
840 | 841 | request: Optional[Union[iam_policy_pb2.SetIamPolicyRequest, dict]] = None, |
841 | 842 | *, |
842 | 843 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
843 | | - timeout: Optional[float] = None, |
| 844 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
844 | 845 | metadata: Sequence[Tuple[str, str]] = (), |
845 | 846 | ) -> policy_pb2.Policy: |
846 | 847 | r"""Sets the access control policy on the specified contentitem |
@@ -987,7 +988,7 @@ async def test_iam_permissions( |
987 | 988 | request: Optional[Union[iam_policy_pb2.TestIamPermissionsRequest, dict]] = None, |
988 | 989 | *, |
989 | 990 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
990 | | - timeout: Optional[float] = None, |
| 991 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
991 | 992 | metadata: Sequence[Tuple[str, str]] = (), |
992 | 993 | ) -> iam_policy_pb2.TestIamPermissionsResponse: |
993 | 994 | r"""Returns the caller's permissions on a resource. If the resource |
@@ -1090,7 +1091,7 @@ async def list_content( |
1090 | 1091 | *, |
1091 | 1092 | parent: Optional[str] = None, |
1092 | 1093 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
1093 | | - timeout: Optional[float] = None, |
| 1094 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1094 | 1095 | metadata: Sequence[Tuple[str, str]] = (), |
1095 | 1096 | ) -> pagers.ListContentAsyncPager: |
1096 | 1097 | r"""List content. |
@@ -1212,7 +1213,7 @@ async def list_operations( |
1212 | 1213 | request: Optional[operations_pb2.ListOperationsRequest] = None, |
1213 | 1214 | *, |
1214 | 1215 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
1215 | | - timeout: Optional[float] = None, |
| 1216 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1216 | 1217 | metadata: Sequence[Tuple[str, str]] = (), |
1217 | 1218 | ) -> operations_pb2.ListOperationsResponse: |
1218 | 1219 | r"""Lists operations that match the specified filter in the request. |
@@ -1266,7 +1267,7 @@ async def get_operation( |
1266 | 1267 | request: Optional[operations_pb2.GetOperationRequest] = None, |
1267 | 1268 | *, |
1268 | 1269 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
1269 | | - timeout: Optional[float] = None, |
| 1270 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1270 | 1271 | metadata: Sequence[Tuple[str, str]] = (), |
1271 | 1272 | ) -> operations_pb2.Operation: |
1272 | 1273 | r"""Gets the latest state of a long-running operation. |
@@ -1320,7 +1321,7 @@ async def delete_operation( |
1320 | 1321 | request: Optional[operations_pb2.DeleteOperationRequest] = None, |
1321 | 1322 | *, |
1322 | 1323 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
1323 | | - timeout: Optional[float] = None, |
| 1324 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1324 | 1325 | metadata: Sequence[Tuple[str, str]] = (), |
1325 | 1326 | ) -> None: |
1326 | 1327 | r"""Deletes a long-running operation. |
@@ -1375,7 +1376,7 @@ async def cancel_operation( |
1375 | 1376 | request: Optional[operations_pb2.CancelOperationRequest] = None, |
1376 | 1377 | *, |
1377 | 1378 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
1378 | | - timeout: Optional[float] = None, |
| 1379 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1379 | 1380 | metadata: Sequence[Tuple[str, str]] = (), |
1380 | 1381 | ) -> None: |
1381 | 1382 | r"""Starts asynchronous cancellation on a long-running operation. |
@@ -1429,7 +1430,7 @@ async def get_location( |
1429 | 1430 | request: Optional[locations_pb2.GetLocationRequest] = None, |
1430 | 1431 | *, |
1431 | 1432 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
1432 | | - timeout: Optional[float] = None, |
| 1433 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1433 | 1434 | metadata: Sequence[Tuple[str, str]] = (), |
1434 | 1435 | ) -> locations_pb2.Location: |
1435 | 1436 | r"""Gets information about a location. |
@@ -1483,7 +1484,7 @@ async def list_locations( |
1483 | 1484 | request: Optional[locations_pb2.ListLocationsRequest] = None, |
1484 | 1485 | *, |
1485 | 1486 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
1486 | | - timeout: Optional[float] = None, |
| 1487 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1487 | 1488 | metadata: Sequence[Tuple[str, str]] = (), |
1488 | 1489 | ) -> locations_pb2.ListLocationsResponse: |
1489 | 1490 | r"""Lists information about the supported locations for this service. |
@@ -1539,14 +1540,9 @@ async def __aexit__(self, exc_type, exc, tb): |
1539 | 1540 | await self.transport.close() |
1540 | 1541 |
|
1541 | 1542 |
|
1542 | | -try: |
1543 | | - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( |
1544 | | - gapic_version=pkg_resources.get_distribution( |
1545 | | - "google-cloud-dataplex", |
1546 | | - ).version, |
1547 | | - ) |
1548 | | -except pkg_resources.DistributionNotFound: |
1549 | | - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() |
| 1543 | +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( |
| 1544 | + gapic_version=package_version.__version__ |
| 1545 | +) |
1550 | 1546 |
|
1551 | 1547 |
|
1552 | 1548 | __all__ = ("ContentServiceAsyncClient",) |
0 commit comments