|
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.gke_multicloud_v1 import gapic_version as package_version |
38 | 39 |
|
39 | 40 | try:
|
40 | 41 | OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
|
@@ -236,7 +237,7 @@ async def create_aws_cluster(
|
236 | 237 | aws_cluster: Optional[aws_resources.AwsCluster] = None,
|
237 | 238 | aws_cluster_id: Optional[str] = None,
|
238 | 239 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
239 |
| - timeout: Optional[float] = None, |
| 240 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
240 | 241 | metadata: Sequence[Tuple[str, str]] = (),
|
241 | 242 | ) -> operation_async.AsyncOperation:
|
242 | 243 | r"""Creates a new
|
@@ -287,7 +288,7 @@ async def sample_create_aws_cluster():
|
287 | 288 |
|
288 | 289 | print("Waiting for operation to complete...")
|
289 | 290 |
|
290 |
| - response = await operation.result() |
| 291 | + response = (await operation).result() |
291 | 292 |
|
292 | 293 | # Handle the response
|
293 | 294 | print(response)
|
@@ -410,7 +411,7 @@ async def update_aws_cluster(
|
410 | 411 | aws_cluster: Optional[aws_resources.AwsCluster] = None,
|
411 | 412 | update_mask: Optional[field_mask_pb2.FieldMask] = None,
|
412 | 413 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
413 |
| - timeout: Optional[float] = None, |
| 414 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
414 | 415 | metadata: Sequence[Tuple[str, str]] = (),
|
415 | 416 | ) -> operation_async.AsyncOperation:
|
416 | 417 | r"""Updates an
|
@@ -454,7 +455,7 @@ async def sample_update_aws_cluster():
|
454 | 455 |
|
455 | 456 | print("Waiting for operation to complete...")
|
456 | 457 |
|
457 |
| - response = await operation.result() |
| 458 | + response = (await operation).result() |
458 | 459 |
|
459 | 460 | # Handle the response
|
460 | 461 | print(response)
|
@@ -576,7 +577,7 @@ async def get_aws_cluster(
|
576 | 577 | *,
|
577 | 578 | name: Optional[str] = None,
|
578 | 579 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
579 |
| - timeout: Optional[float] = None, |
| 580 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
580 | 581 | metadata: Sequence[Tuple[str, str]] = (),
|
581 | 582 | ) -> aws_resources.AwsCluster:
|
582 | 583 | r"""Describes a specific
|
@@ -694,7 +695,7 @@ async def list_aws_clusters(
|
694 | 695 | *,
|
695 | 696 | parent: Optional[str] = None,
|
696 | 697 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
697 |
| - timeout: Optional[float] = None, |
| 698 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
698 | 699 | metadata: Sequence[Tuple[str, str]] = (),
|
699 | 700 | ) -> pagers.ListAwsClustersAsyncPager:
|
700 | 701 | r"""Lists all [AwsCluster][google.cloud.gkemulticloud.v1.AwsCluster]
|
@@ -827,7 +828,7 @@ async def delete_aws_cluster(
|
827 | 828 | *,
|
828 | 829 | name: Optional[str] = None,
|
829 | 830 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
830 |
| - timeout: Optional[float] = None, |
| 831 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
831 | 832 | metadata: Sequence[Tuple[str, str]] = (),
|
832 | 833 | ) -> operation_async.AsyncOperation:
|
833 | 834 | r"""Deletes a specific
|
@@ -866,7 +867,7 @@ async def sample_delete_aws_cluster():
|
866 | 867 |
|
867 | 868 | print("Waiting for operation to complete...")
|
868 | 869 |
|
869 |
| - response = await operation.result() |
| 870 | + response = (await operation).result() |
870 | 871 |
|
871 | 872 | # Handle the response
|
872 | 873 | print(response)
|
@@ -969,7 +970,7 @@ async def generate_aws_access_token(
|
969 | 970 | ] = None,
|
970 | 971 | *,
|
971 | 972 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
972 |
| - timeout: Optional[float] = None, |
| 973 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
973 | 974 | metadata: Sequence[Tuple[str, str]] = (),
|
974 | 975 | ) -> aws_service.GenerateAwsAccessTokenResponse:
|
975 | 976 | r"""Generates a short-lived access token to authenticate to a given
|
@@ -1064,7 +1065,7 @@ async def create_aws_node_pool(
|
1064 | 1065 | aws_node_pool: Optional[aws_resources.AwsNodePool] = None,
|
1065 | 1066 | aws_node_pool_id: Optional[str] = None,
|
1066 | 1067 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
1067 |
| - timeout: Optional[float] = None, |
| 1068 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1068 | 1069 | metadata: Sequence[Tuple[str, str]] = (),
|
1069 | 1070 | ) -> operation_async.AsyncOperation:
|
1070 | 1071 | r"""Creates a new
|
@@ -1112,7 +1113,7 @@ async def sample_create_aws_node_pool():
|
1112 | 1113 |
|
1113 | 1114 | print("Waiting for operation to complete...")
|
1114 | 1115 |
|
1115 |
| - response = await operation.result() |
| 1116 | + response = (await operation).result() |
1116 | 1117 |
|
1117 | 1118 | # Handle the response
|
1118 | 1119 | print(response)
|
@@ -1235,7 +1236,7 @@ async def update_aws_node_pool(
|
1235 | 1236 | aws_node_pool: Optional[aws_resources.AwsNodePool] = None,
|
1236 | 1237 | update_mask: Optional[field_mask_pb2.FieldMask] = None,
|
1237 | 1238 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
1238 |
| - timeout: Optional[float] = None, |
| 1239 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1239 | 1240 | metadata: Sequence[Tuple[str, str]] = (),
|
1240 | 1241 | ) -> operation_async.AsyncOperation:
|
1241 | 1242 | r"""Updates an
|
@@ -1275,7 +1276,7 @@ async def sample_update_aws_node_pool():
|
1275 | 1276 |
|
1276 | 1277 | print("Waiting for operation to complete...")
|
1277 | 1278 |
|
1278 |
| - response = await operation.result() |
| 1279 | + response = (await operation).result() |
1279 | 1280 |
|
1280 | 1281 | # Handle the response
|
1281 | 1282 | print(response)
|
@@ -1392,7 +1393,7 @@ async def get_aws_node_pool(
|
1392 | 1393 | *,
|
1393 | 1394 | name: Optional[str] = None,
|
1394 | 1395 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
1395 |
| - timeout: Optional[float] = None, |
| 1396 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1396 | 1397 | metadata: Sequence[Tuple[str, str]] = (),
|
1397 | 1398 | ) -> aws_resources.AwsNodePool:
|
1398 | 1399 | r"""Describes a specific
|
@@ -1511,7 +1512,7 @@ async def list_aws_node_pools(
|
1511 | 1512 | *,
|
1512 | 1513 | parent: Optional[str] = None,
|
1513 | 1514 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
1514 |
| - timeout: Optional[float] = None, |
| 1515 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1515 | 1516 | metadata: Sequence[Tuple[str, str]] = (),
|
1516 | 1517 | ) -> pagers.ListAwsNodePoolsAsyncPager:
|
1517 | 1518 | r"""Lists all
|
@@ -1647,7 +1648,7 @@ async def delete_aws_node_pool(
|
1647 | 1648 | *,
|
1648 | 1649 | name: Optional[str] = None,
|
1649 | 1650 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
1650 |
| - timeout: Optional[float] = None, |
| 1651 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1651 | 1652 | metadata: Sequence[Tuple[str, str]] = (),
|
1652 | 1653 | ) -> operation_async.AsyncOperation:
|
1653 | 1654 | r"""Deletes a specific
|
@@ -1683,7 +1684,7 @@ async def sample_delete_aws_node_pool():
|
1683 | 1684 |
|
1684 | 1685 | print("Waiting for operation to complete...")
|
1685 | 1686 |
|
1686 |
| - response = await operation.result() |
| 1687 | + response = (await operation).result() |
1687 | 1688 |
|
1688 | 1689 | # Handle the response
|
1689 | 1690 | print(response)
|
@@ -1785,7 +1786,7 @@ async def get_aws_server_config(
|
1785 | 1786 | *,
|
1786 | 1787 | name: Optional[str] = None,
|
1787 | 1788 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
1788 |
| - timeout: Optional[float] = None, |
| 1789 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1789 | 1790 | metadata: Sequence[Tuple[str, str]] = (),
|
1790 | 1791 | ) -> aws_resources.AwsServerConfig:
|
1791 | 1792 | r"""Returns information, such as supported AWS regions
|
@@ -1907,14 +1908,9 @@ async def __aexit__(self, exc_type, exc, tb):
|
1907 | 1908 | await self.transport.close()
|
1908 | 1909 |
|
1909 | 1910 |
|
1910 |
| -try: |
1911 |
| - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( |
1912 |
| - gapic_version=pkg_resources.get_distribution( |
1913 |
| - "google-cloud-gke-multicloud", |
1914 |
| - ).version, |
1915 |
| - ) |
1916 |
| -except pkg_resources.DistributionNotFound: |
1917 |
| - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() |
| 1911 | +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( |
| 1912 | + gapic_version=package_version.__version__ |
| 1913 | +) |
1918 | 1914 |
|
1919 | 1915 |
|
1920 | 1916 | __all__ = ("AwsClustersAsyncClient",)
|
0 commit comments