|
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.eventarc_v1 import gapic_version as package_version |
38 | 39 |
|
39 | 40 | try:
|
40 | 41 | OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
|
@@ -255,7 +256,7 @@ async def get_trigger(
|
255 | 256 | *,
|
256 | 257 | name: Optional[str] = None,
|
257 | 258 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
258 |
| - timeout: Optional[float] = None, |
| 259 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
259 | 260 | metadata: Sequence[Tuple[str, str]] = (),
|
260 | 261 | ) -> trigger.Trigger:
|
261 | 262 | r"""Get a single trigger.
|
@@ -357,7 +358,7 @@ async def list_triggers(
|
357 | 358 | *,
|
358 | 359 | parent: Optional[str] = None,
|
359 | 360 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
360 |
| - timeout: Optional[float] = None, |
| 361 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
361 | 362 | metadata: Sequence[Tuple[str, str]] = (),
|
362 | 363 | ) -> pagers.ListTriggersAsyncPager:
|
363 | 364 | r"""List triggers.
|
@@ -473,7 +474,7 @@ async def create_trigger(
|
473 | 474 | trigger: Optional[gce_trigger.Trigger] = None,
|
474 | 475 | trigger_id: Optional[str] = None,
|
475 | 476 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
476 |
| - timeout: Optional[float] = None, |
| 477 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
477 | 478 | metadata: Sequence[Tuple[str, str]] = (),
|
478 | 479 | ) -> operation_async.AsyncOperation:
|
479 | 480 | r"""Create a new trigger in a particular project and
|
@@ -514,7 +515,7 @@ async def sample_create_trigger():
|
514 | 515 |
|
515 | 516 | print("Waiting for operation to complete...")
|
516 | 517 |
|
517 |
| - response = await operation.result() |
| 518 | + response = (await operation).result() |
518 | 519 |
|
519 | 520 | # Handle the response
|
520 | 521 | print(response)
|
@@ -619,7 +620,7 @@ async def update_trigger(
|
619 | 620 | update_mask: Optional[field_mask_pb2.FieldMask] = None,
|
620 | 621 | allow_missing: Optional[bool] = None,
|
621 | 622 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
622 |
| - timeout: Optional[float] = None, |
| 623 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
623 | 624 | metadata: Sequence[Tuple[str, str]] = (),
|
624 | 625 | ) -> operation_async.AsyncOperation:
|
625 | 626 | r"""Update a single trigger.
|
@@ -649,7 +650,7 @@ async def sample_update_trigger():
|
649 | 650 |
|
650 | 651 | print("Waiting for operation to complete...")
|
651 | 652 |
|
652 |
| - response = await operation.result() |
| 653 | + response = (await operation).result() |
653 | 654 |
|
654 | 655 | # Handle the response
|
655 | 656 | print(response)
|
@@ -758,7 +759,7 @@ async def delete_trigger(
|
758 | 759 | name: Optional[str] = None,
|
759 | 760 | allow_missing: Optional[bool] = None,
|
760 | 761 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
761 |
| - timeout: Optional[float] = None, |
| 762 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
762 | 763 | metadata: Sequence[Tuple[str, str]] = (),
|
763 | 764 | ) -> operation_async.AsyncOperation:
|
764 | 765 | r"""Delete a single trigger.
|
@@ -789,7 +790,7 @@ async def sample_delete_trigger():
|
789 | 790 |
|
790 | 791 | print("Waiting for operation to complete...")
|
791 | 792 |
|
792 |
| - response = await operation.result() |
| 793 | + response = (await operation).result() |
793 | 794 |
|
794 | 795 | # Handle the response
|
795 | 796 | print(response)
|
@@ -886,7 +887,7 @@ async def get_channel(
|
886 | 887 | *,
|
887 | 888 | name: Optional[str] = None,
|
888 | 889 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
889 |
| - timeout: Optional[float] = None, |
| 890 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
890 | 891 | metadata: Sequence[Tuple[str, str]] = (),
|
891 | 892 | ) -> channel.Channel:
|
892 | 893 | r"""Get a single Channel.
|
@@ -994,7 +995,7 @@ async def list_channels(
|
994 | 995 | *,
|
995 | 996 | parent: Optional[str] = None,
|
996 | 997 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
997 |
| - timeout: Optional[float] = None, |
| 998 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
998 | 999 | metadata: Sequence[Tuple[str, str]] = (),
|
999 | 1000 | ) -> pagers.ListChannelsAsyncPager:
|
1000 | 1001 | r"""List channels.
|
@@ -1110,7 +1111,7 @@ async def create_channel(
|
1110 | 1111 | channel: Optional[gce_channel.Channel] = None,
|
1111 | 1112 | channel_id: Optional[str] = None,
|
1112 | 1113 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
1113 |
| - timeout: Optional[float] = None, |
| 1114 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1114 | 1115 | metadata: Sequence[Tuple[str, str]] = (),
|
1115 | 1116 | ) -> operation_async.AsyncOperation:
|
1116 | 1117 | r"""Create a new channel in a particular project and
|
@@ -1148,7 +1149,7 @@ async def sample_create_channel():
|
1148 | 1149 |
|
1149 | 1150 | print("Waiting for operation to complete...")
|
1150 | 1151 |
|
1151 |
| - response = await operation.result() |
| 1152 | + response = (await operation).result() |
1152 | 1153 |
|
1153 | 1154 | # Handle the response
|
1154 | 1155 | print(response)
|
@@ -1255,7 +1256,7 @@ async def update_channel(
|
1255 | 1256 | channel: Optional[gce_channel.Channel] = None,
|
1256 | 1257 | update_mask: Optional[field_mask_pb2.FieldMask] = None,
|
1257 | 1258 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
1258 |
| - timeout: Optional[float] = None, |
| 1259 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1259 | 1260 | metadata: Sequence[Tuple[str, str]] = (),
|
1260 | 1261 | ) -> operation_async.AsyncOperation:
|
1261 | 1262 | r"""Update a single channel.
|
@@ -1285,7 +1286,7 @@ async def sample_update_channel():
|
1285 | 1286 |
|
1286 | 1287 | print("Waiting for operation to complete...")
|
1287 | 1288 |
|
1288 |
| - response = await operation.result() |
| 1289 | + response = (await operation).result() |
1289 | 1290 |
|
1290 | 1291 | # Handle the response
|
1291 | 1292 | print(response)
|
@@ -1386,7 +1387,7 @@ async def delete_channel(
|
1386 | 1387 | *,
|
1387 | 1388 | name: Optional[str] = None,
|
1388 | 1389 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
1389 |
| - timeout: Optional[float] = None, |
| 1390 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1390 | 1391 | metadata: Sequence[Tuple[str, str]] = (),
|
1391 | 1392 | ) -> operation_async.AsyncOperation:
|
1392 | 1393 | r"""Delete a single channel.
|
@@ -1417,7 +1418,7 @@ async def sample_delete_channel():
|
1417 | 1418 |
|
1418 | 1419 | print("Waiting for operation to complete...")
|
1419 | 1420 |
|
1420 |
| - response = await operation.result() |
| 1421 | + response = (await operation).result() |
1421 | 1422 |
|
1422 | 1423 | # Handle the response
|
1423 | 1424 | print(response)
|
@@ -1507,7 +1508,7 @@ async def get_provider(
|
1507 | 1508 | *,
|
1508 | 1509 | name: Optional[str] = None,
|
1509 | 1510 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
1510 |
| - timeout: Optional[float] = None, |
| 1511 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1511 | 1512 | metadata: Sequence[Tuple[str, str]] = (),
|
1512 | 1513 | ) -> discovery.Provider:
|
1513 | 1514 | r"""Get a single Provider.
|
@@ -1609,7 +1610,7 @@ async def list_providers(
|
1609 | 1610 | *,
|
1610 | 1611 | parent: Optional[str] = None,
|
1611 | 1612 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
1612 |
| - timeout: Optional[float] = None, |
| 1613 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1613 | 1614 | metadata: Sequence[Tuple[str, str]] = (),
|
1614 | 1615 | ) -> pagers.ListProvidersAsyncPager:
|
1615 | 1616 | r"""List providers.
|
@@ -1723,7 +1724,7 @@ async def get_channel_connection(
|
1723 | 1724 | *,
|
1724 | 1725 | name: Optional[str] = None,
|
1725 | 1726 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
1726 |
| - timeout: Optional[float] = None, |
| 1727 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1727 | 1728 | metadata: Sequence[Tuple[str, str]] = (),
|
1728 | 1729 | ) -> channel_connection.ChannelConnection:
|
1729 | 1730 | r"""Get a single ChannelConnection.
|
@@ -1830,7 +1831,7 @@ async def list_channel_connections(
|
1830 | 1831 | *,
|
1831 | 1832 | parent: Optional[str] = None,
|
1832 | 1833 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
1833 |
| - timeout: Optional[float] = None, |
| 1834 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1834 | 1835 | metadata: Sequence[Tuple[str, str]] = (),
|
1835 | 1836 | ) -> pagers.ListChannelConnectionsAsyncPager:
|
1836 | 1837 | r"""List channel connections.
|
@@ -1947,7 +1948,7 @@ async def create_channel_connection(
|
1947 | 1948 | channel_connection: Optional[gce_channel_connection.ChannelConnection] = None,
|
1948 | 1949 | channel_connection_id: Optional[str] = None,
|
1949 | 1950 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
1950 |
| - timeout: Optional[float] = None, |
| 1951 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1951 | 1952 | metadata: Sequence[Tuple[str, str]] = (),
|
1952 | 1953 | ) -> operation_async.AsyncOperation:
|
1953 | 1954 | r"""Create a new ChannelConnection in a particular
|
@@ -1984,7 +1985,7 @@ async def sample_create_channel_connection():
|
1984 | 1985 |
|
1985 | 1986 | print("Waiting for operation to complete...")
|
1986 | 1987 |
|
1987 |
| - response = await operation.result() |
| 1988 | + response = (await operation).result() |
1988 | 1989 |
|
1989 | 1990 | # Handle the response
|
1990 | 1991 | print(response)
|
@@ -2091,7 +2092,7 @@ async def delete_channel_connection(
|
2091 | 2092 | *,
|
2092 | 2093 | name: Optional[str] = None,
|
2093 | 2094 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
2094 |
| - timeout: Optional[float] = None, |
| 2095 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
2095 | 2096 | metadata: Sequence[Tuple[str, str]] = (),
|
2096 | 2097 | ) -> operation_async.AsyncOperation:
|
2097 | 2098 | r"""Delete a single ChannelConnection.
|
@@ -2121,7 +2122,7 @@ async def sample_delete_channel_connection():
|
2121 | 2122 |
|
2122 | 2123 | print("Waiting for operation to complete...")
|
2123 | 2124 |
|
2124 |
| - response = await operation.result() |
| 2125 | + response = (await operation).result() |
2125 | 2126 |
|
2126 | 2127 | # Handle the response
|
2127 | 2128 | print(response)
|
@@ -2210,7 +2211,7 @@ async def get_google_channel_config(
|
2210 | 2211 | *,
|
2211 | 2212 | name: Optional[str] = None,
|
2212 | 2213 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
2213 |
| - timeout: Optional[float] = None, |
| 2214 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
2214 | 2215 | metadata: Sequence[Tuple[str, str]] = (),
|
2215 | 2216 | ) -> google_channel_config.GoogleChannelConfig:
|
2216 | 2217 | r"""Get a GoogleChannelConfig
|
@@ -2323,7 +2324,7 @@ async def update_google_channel_config(
|
2323 | 2324 | ] = None,
|
2324 | 2325 | update_mask: Optional[field_mask_pb2.FieldMask] = None,
|
2325 | 2326 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
2326 |
| - timeout: Optional[float] = None, |
| 2327 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
2327 | 2328 | metadata: Sequence[Tuple[str, str]] = (),
|
2328 | 2329 | ) -> gce_google_channel_config.GoogleChannelConfig:
|
2329 | 2330 | r"""Update a single GoogleChannelConfig
|
@@ -2444,7 +2445,7 @@ async def list_operations(
|
2444 | 2445 | request: Optional[operations_pb2.ListOperationsRequest] = None,
|
2445 | 2446 | *,
|
2446 | 2447 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
2447 |
| - timeout: Optional[float] = None, |
| 2448 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
2448 | 2449 | metadata: Sequence[Tuple[str, str]] = (),
|
2449 | 2450 | ) -> operations_pb2.ListOperationsResponse:
|
2450 | 2451 | r"""Lists operations that match the specified filter in the request.
|
@@ -2498,7 +2499,7 @@ async def get_operation(
|
2498 | 2499 | request: Optional[operations_pb2.GetOperationRequest] = None,
|
2499 | 2500 | *,
|
2500 | 2501 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
2501 |
| - timeout: Optional[float] = None, |
| 2502 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
2502 | 2503 | metadata: Sequence[Tuple[str, str]] = (),
|
2503 | 2504 | ) -> operations_pb2.Operation:
|
2504 | 2505 | r"""Gets the latest state of a long-running operation.
|
@@ -2552,7 +2553,7 @@ async def delete_operation(
|
2552 | 2553 | request: Optional[operations_pb2.DeleteOperationRequest] = None,
|
2553 | 2554 | *,
|
2554 | 2555 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
2555 |
| - timeout: Optional[float] = None, |
| 2556 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
2556 | 2557 | metadata: Sequence[Tuple[str, str]] = (),
|
2557 | 2558 | ) -> None:
|
2558 | 2559 | r"""Deletes a long-running operation.
|
@@ -2607,7 +2608,7 @@ async def cancel_operation(
|
2607 | 2608 | request: Optional[operations_pb2.CancelOperationRequest] = None,
|
2608 | 2609 | *,
|
2609 | 2610 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
2610 |
| - timeout: Optional[float] = None, |
| 2611 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
2611 | 2612 | metadata: Sequence[Tuple[str, str]] = (),
|
2612 | 2613 | ) -> None:
|
2613 | 2614 | r"""Starts asynchronous cancellation on a long-running operation.
|
@@ -2661,7 +2662,7 @@ async def set_iam_policy(
|
2661 | 2662 | request: Optional[iam_policy_pb2.SetIamPolicyRequest] = None,
|
2662 | 2663 | *,
|
2663 | 2664 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
2664 |
| - timeout: Optional[float] = None, |
| 2665 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
2665 | 2666 | metadata: Sequence[Tuple[str, str]] = (),
|
2666 | 2667 | ) -> policy_pb2.Policy:
|
2667 | 2668 | r"""Sets the IAM access control policy on the specified function.
|
@@ -2781,7 +2782,7 @@ async def get_iam_policy(
|
2781 | 2782 | request: Optional[iam_policy_pb2.GetIamPolicyRequest] = None,
|
2782 | 2783 | *,
|
2783 | 2784 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
2784 |
| - timeout: Optional[float] = None, |
| 2785 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
2785 | 2786 | metadata: Sequence[Tuple[str, str]] = (),
|
2786 | 2787 | ) -> policy_pb2.Policy:
|
2787 | 2788 | r"""Gets the IAM access control policy for a function.
|
@@ -2902,7 +2903,7 @@ async def test_iam_permissions(
|
2902 | 2903 | request: Optional[iam_policy_pb2.TestIamPermissionsRequest] = None,
|
2903 | 2904 | *,
|
2904 | 2905 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
2905 |
| - timeout: Optional[float] = None, |
| 2906 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
2906 | 2907 | metadata: Sequence[Tuple[str, str]] = (),
|
2907 | 2908 | ) -> iam_policy_pb2.TestIamPermissionsResponse:
|
2908 | 2909 | r"""Tests the specified IAM permissions against the IAM access control
|
@@ -2961,7 +2962,7 @@ async def get_location(
|
2961 | 2962 | request: Optional[locations_pb2.GetLocationRequest] = None,
|
2962 | 2963 | *,
|
2963 | 2964 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
2964 |
| - timeout: Optional[float] = None, |
| 2965 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
2965 | 2966 | metadata: Sequence[Tuple[str, str]] = (),
|
2966 | 2967 | ) -> locations_pb2.Location:
|
2967 | 2968 | r"""Gets information about a location.
|
@@ -3015,7 +3016,7 @@ async def list_locations(
|
3015 | 3016 | request: Optional[locations_pb2.ListLocationsRequest] = None,
|
3016 | 3017 | *,
|
3017 | 3018 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
3018 |
| - timeout: Optional[float] = None, |
| 3019 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
3019 | 3020 | metadata: Sequence[Tuple[str, str]] = (),
|
3020 | 3021 | ) -> locations_pb2.ListLocationsResponse:
|
3021 | 3022 | r"""Lists information about the supported locations for this service.
|
@@ -3071,14 +3072,9 @@ async def __aexit__(self, exc_type, exc, tb):
|
3071 | 3072 | await self.transport.close()
|
3072 | 3073 |
|
3073 | 3074 |
|
3074 |
| -try: |
3075 |
| - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( |
3076 |
| - gapic_version=pkg_resources.get_distribution( |
3077 |
| - "google-cloud-eventarc", |
3078 |
| - ).version, |
3079 |
| - ) |
3080 |
| -except pkg_resources.DistributionNotFound: |
3081 |
| - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() |
| 3075 | +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( |
| 3076 | + gapic_version=package_version.__version__ |
| 3077 | +) |
3082 | 3078 |
|
3083 | 3079 |
|
3084 | 3080 | __all__ = ("EventarcAsyncClient",)
|
0 commit comments