|
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.metastore_v1 import gapic_version as package_version |
38 | 39 |
|
39 | 40 | try:
|
40 | 41 | OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
|
@@ -257,7 +258,7 @@ async def list_services(
|
257 | 258 | *,
|
258 | 259 | parent: Optional[str] = None,
|
259 | 260 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
260 |
| - timeout: Optional[float] = None, |
| 261 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
261 | 262 | metadata: Sequence[Tuple[str, str]] = (),
|
262 | 263 | ) -> pagers.ListServicesAsyncPager:
|
263 | 264 | r"""Lists services in a project and location.
|
@@ -374,7 +375,7 @@ async def get_service(
|
374 | 375 | *,
|
375 | 376 | name: Optio
F42D
nal[str] = None,
|
376 | 377 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
377 |
| - timeout: Optional[float] = None, |
| 378 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
378 | 379 | metadata: Sequence[Tuple[str, str]] = (),
|
379 | 380 | ) -> metastore.Service:
|
380 | 381 | r"""Gets the details of a single service.
|
@@ -480,7 +481,7 @@ async def create_service(
|
480 | 481 | service: Optional[metastore.Service] = None,
|
481 | 482 | service_id: Optional[str] = None,
|
482 | 483 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
483 |
| - timeout: Optional[float] = None, |
| 484 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
484 | 485 | metadata: Sequence[Tuple[str, str]] = (),
|
485 | 486 | ) -> operation_async.AsyncOperation:
|
486 | 487 | r"""Creates a metastore service in a project and
|
@@ -512,7 +513,7 @@ async def sample_create_service():
|
512 | 513 |
|
513 | 514 | print("Waiting for operation to complete...")
|
514 | 515 |
|
515 |
| - response = await operation.result() |
| 516 | + response = (await operation).result() |
516 | 517 |
|
517 | 518 | # Handle the response
|
518 | 519 | print(response)
|
@@ -630,7 +631,7 @@ async def update_service(
|
630 | 631 | service: Optional[metastore.Service] = None,
|
631 | 632 | update_mask: Optional[field_mask_pb2.FieldMask] = None,
|
632 | 633 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
633 |
| - timeout: Optional[float] = None, |
| 634 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
634 | 635 | metadata: Sequence[Tuple[str, str]] = (),
|
635 | 636 | ) -> operation_async.AsyncOperation:
|
636 | 637 | r"""Updates the parameters of a single service.
|
@@ -659,7 +660,7 @@ async def sample_update_service():
|
659 | 660 |
|
660 | 661 | print("Waiting for operation to complete...")
|
661 | 662 |
|
662 |
| - response = await operation.result() |
| 663 | + response = (await operation).result() |
663 | 664 |
|
664 | 665 | # Handle the response
|
665 | 666 | print(response)
|
@@ -764,7 +765,7 @@ async def delete_service(
|
764 | 765 | *,
|
765 | 766 | name: Optional[str] = None,
|
766 | 767 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
767 |
| - timeout: Optional[float] = None, |
| 768 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
768 | 769 | metadata: Sequence[Tuple[str, str]] = (),
|
769 | 770 | ) -> operation_async.AsyncOperation:
|
770 | 771 | r"""Deletes a single service.
|
@@ -794,7 +795,7 @@ async def sample_delete_service():
|
794 | 795 |
|
795 | 796 | print("Waiting for operation to complete...")
|
796 | 797 |
|
797 |
| - response = await operation.result() |
| 798 | + response = (await operation).result() |
798 | 799 |
|
799 | 800 | # Handle the response
|
800 | 801 | print(response)
|
@@ -890,7 +891,7 @@ async def list_metadata_imports(
|
890 | 891 | *,
|
891 | 892 | parent: Optional[str] = None,
|
892 | 893 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
893 |
| - timeout: Optional[float] = None, |
| 894 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
894 | 895 | metadata: Sequence[Tuple[str, str]] = (),
|
895 | 896 | ) -> pagers.ListMetadataImportsAsyncPager:
|
896 | 897 | r"""Lists imports in a service.
|
@@ -1007,7 +1008,7 @@ async def get_metadata_import(
|
1007 | 1008 | *,
|
1008 | 1009 | name: Optional[str] = None,
|
1009 | 1010 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
1010 |
| - timeout: Optional[float] = None, |
| 1011 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1011 | 1012 | metadata: Sequence[Tuple[str, str]] = (),
|
1012 | 1013 | ) -> metastore.MetadataImport:
|
1013 | 1014 | r"""Gets details of a single import.
|
@@ -1113,7 +1114,7 @@ async def create_metadata_import(
|
1113 | 1114 | metadata_import: Optional[metastore.MetadataImport] = None,
|
1114 | 1115 | metadata_import_id: Optional[str] = None,
|
1115 | 1116 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
1116 |
| - timeout: Optional[float] = None, |
| 1117 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1117 | 1118 | metadata: Sequence[Tuple[str, str]] = (),
|
1118 | 1119 | ) -> operation_async.AsyncOperation:
|
1119 | 1120 | r"""Creates a new MetadataImport in a given project and
|
@@ -1145,7 +1146,7 @@ async def sample_create_metadata_import():
|
1145 | 1146 |
|
1146 | 1147 | print("Waiting for operation to complete...")
|
1147 | 1148 |
|
1148 |
| - response = await operation.result() |
| 1149 | + response = (await operation).result() |
1149 | 1150 |
|
1150 | 1151 | # Handle the response
|
1151 | 1152 | print(response)
|
@@ -1262,7 +1263,7 @@ async def update_metadata_import(
|
1262 | 1263 | metadata_import: Optional[metastore.MetadataImport] = None,
|
1263 | 1264 | update_mask: Optional[field_mask_pb2.FieldMask] = None,
|
1264 | 1265 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
1265 |
| - timeout: Optional[float] = None, |
| 1266 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1266 | 1267 | metadata: Sequence[Tuple[str, str]] = (),
|
1267 | 1268 | ) -> operation_async.AsyncOperation:
|
1268 | 1269 | r"""Updates a single import.
|
@@ -1293,7 +1294,7 @@ async def sample_update_metadata_import():
|
1293 | 1294 |
|
1294 | 1295 | print("Waiting for operation to complete...")
|
1295 | 1296 |
|
1296 |
| - response = await operation.result() |
| 1297 | + response = (await operation).result() |
1297 | 1298 |
|
1298 | 1299 | # Handle the response
|
1299 | 1300 | print(response)
|
@@ -1397,7 +1398,7 @@ async def export_metadata(
|
1397 | 1398 | request: Optional[Union[metastore.ExportMetadataRequest, dict]] = None,
|
1398 | 1399 | *,
|
1399 | 1400 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
1400 |
| - timeout: Optional[float] = None, |
| 1401 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1401 | 1402 | metadata: Sequence[Tuple[str, str]] = (),
|
1402 | 1403 | ) -> operation_async.AsyncOperation:
|
1403 | 1404 | r"""Exports metadata from a service.
|
@@ -1428,7 +1429,7 @@ async def sample_export_metadata():
|
1428 | 1429 |
|
1429 | 1430 | print("Waiting for operation to complete...")
|
1430 | 1431 |
|
1431 |
| - response = await operation.result() |
| 1432 | + response = (await operation).result() |
1432 | 1433 |
|
1433 | 1434 | # Handle the response
|
1434 | 1435 | print(response)
|
@@ -1495,7 +1496,7 @@ async def restore_service(
|
1495 | 1496 | service: Optional[str] = None,
|
1496 | 1497 | backup: Optional[str] = None,
|
1497 | 1498 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
1498 |
| - timeout: Optional[float] = None, |
| 1499 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1499 | 1500 | metadata: Sequence[Tuple[str, str]] = (),
|
1500 | 1501 | ) -> operation_async.AsyncOperation:
|
1501 | 1502 | r"""Restores a service from a backup.
|
@@ -1526,7 +1527,7 @@ async def sample_restore_service():
|
1526 | 1527 |
|
1527 | 1528 | print("Waiting for operation to complete...")
|
1528 | 1529 |
|
1529 |
| - response = await operation.result() |
| 1530 | + response = (await operation).result() |
1530 | 1531 |
|
1531 | 1532 | # Handle the response
|
1532 | 1533 | print(response)
|
@@ -1626,7 +1627,7 @@ async def list_backups(
|
1626 | 1627 | *,
|
1627 | 1628 | parent: Optional[str] = None,
|
1628 | 1629 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
1629 |
| - timeout: Optional[float] = None, |
| 1630 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1630 | 1631 | metadata: Sequence[Tuple[str, str]] = (),
|
1631 | 1632 | ) -> pagers.ListBackupsAsyncPager:
|
1632 | 1633 | r"""Lists backups in a service.
|
@@ -1743,7 +1744,7 @@ async def get_backup(
|
1743 | 1744 | *,
|
1744 | 1745 | name: Optional[str] = None,
|
1745 | 1746 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
1746 |
| - timeout: Optional[float] = None, |
| 1747 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1747 | 1748 | metadata: Sequence[Tuple[str, str]] = (),
|
1748 | 1749 | ) -> metastore.Backup:
|
1749 | 1750 | r"""Ge
10000
ts details of a single backup.
|
@@ -1847,7 +1848,7 @@ async def create_backup(
|
1847 | 1848 | backup: Optional[metastore.Backup] = None,
|
1848 | 1849 | backup_id: Optional[str] = None,
|
1849 | 1850 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
1850 |
| - timeout: Optional[float] = None, |
| 1851 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1851 | 1852 | metadata: Sequence[Tuple[str, str]] = (),
|
1852 | 1853 | ) -> operation_async.AsyncOperation:
|
1853 | 1854 | r"""Creates a new backup in a given project and location.
|
@@ -1878,7 +1879,7 @@ async def sample_create_backup():
|
1878 | 1879 |
|
1879 | 1880 | print("Waiting for operation to complete...")
|
1880 | 1881 |
|
1881 |
| - response = await operation.result() |
| 1882 | + response = (await operation).result() |
1882 | 1883 |
|
1883 | 1884 | # Handle the response
|
1884 | 1885 | print(response)
|
@@ -1992,7 +1993,7 @@ async def delete_backup(
|
1992 | 1993 | *,
|
1993 | 1994 | name: Optional[str] = None,
|
1994 | 1995 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
1995 |
| - timeout: Optional[float] = None, |
| 1996 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1996 | 1997 | metadata: Sequence[Tuple[str, str]] = (),
|
1997 | 1998 | ) -> operation_async.AsyncOperation:
|
1998 | 1999 | r"""Deletes a single backup.
|
@@ -2022,7 +2023,7 @@ async def sample_delete_backup():
|
2022 | 2023 |
|
2023 | 2024 | print("Waiting for operation to complete...")
|
2024 | 2025 |
|
2025 |
| - response = await operation.result() |
| 2026 | + response = (await operation).result() |
2026 | 2027 |
|
2027 | 2028 | # Handle the response
|
2028 | 2029 | print(response)
|
@@ -2119,14 +2120,9 @@ async def __aexit__(self, exc_type, exc, tb):
|
2119 | 2120 | await self.transport.close()
|
2120 | 2121 |
|
2121 | 2122 |
|
2122 |
| -try: |
2123 |
| - DEFAULT_CLIENT_INFO = gapic_v1.client_info.Clien
75DC
tInfo( |
2124 |
| - gapic_version=pkg_resources.get_distribution( |
2125 |
| - "google-cloud-dataproc-metastore", |
2126 |
| - ).version, |
2127 |
| - ) |
2128 |
| -except pkg_resources.DistributionNotFound: |
2129 |
| - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() |
| 2123 | +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( |
| 2124 | + gapic_version=package_version.__version__ |
| 2125 | +) |
2130 | 2126 |
|
2131 | 2127 |
|
2132 | 2128 | __all__ = ("DataprocMetastoreAsyncClient",)
|
0 commit comments