|
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.beyondcorp_clientconnectorservices_v1 import ( |
| 39 | + gapic_version as package_version, |
| 40 | +) |
38 | 41 |
|
39 | 42 | try: |
40 | 43 | OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] |
@@ -263,7 +266,7 @@ async def list_client_connector_services( |
263 | 266 | *, |
264 | 267 | parent: Optional[str] = None, |
265 | 268 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
266 | | - timeout: Optional[float] = None, |
| 269 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
267 | 270 | metadata: Sequence[Tuple[str, str]] = (), |
268 | 271 | ) -> pagers.ListClientConnectorServicesAsyncPager: |
269 | 272 | r"""Lists ClientConnectorServices in a given project and |
@@ -385,7 +388,7 @@ async def get_client_connector_service( |
385 | 388 | *, |
386 | 389 | name: Optional[str] = None, |
387 | 390 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
388 | | - timeout: Optional[float] = None, |
| 391 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
389 | 392 | metadata: Sequence[Tuple[str, str]] = (), |
390 | 393 | ) -> client_connector_services_service.ClientConnectorService: |
391 | 394 | r"""Gets details of a single ClientConnectorService. |
@@ -496,7 +499,7 @@ async def create_client_connector_service( |
496 | 499 | ] = None, |
497 | 500 | client_connector_service_id: Optional[str] = None, |
498 | 501 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
499 | | - timeout: Optional[float] = None, |
| 502 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
500 | 503 | metadata: Sequence[Tuple[str, str]] = (), |
501 | 504 | ) -> operation_async.AsyncOperation: |
502 | 505 | r"""Creates a new ClientConnectorService in a given |
@@ -535,7 +538,7 @@ async def sample_create_client_connector_service(): |
535 | 538 |
|
536 | 539 | print("Waiting for operation to complete...") |
537 | 540 |
|
538 | | - response = await operation.result() |
| 541 | + response = (await operation).result() |
539 | 542 |
|
540 | 543 | # Handle the response |
541 | 544 | print(response) |
@@ -656,7 +659,7 @@ async def update_client_connector_service( |
656 | 659 | ] = None, |
657 | 660 | update_mask: Optional[field_mask_pb2.FieldMask] = None, |
658 | 661 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
659 | | - timeout: Optional[float] = None, |
| 662 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
660 | 663 | metadata: Sequence[Tuple[str, str]] = (), |
661 | 664 | ) -> operation_async.AsyncOperation: |
662 | 665 | r"""Updates the parameters of a single |
@@ -694,7 +697,7 @@ async def sample_update_client_connector_service(): |
694 | 697 |
|
695 | 698 | print("Waiting for operation to complete...") |
696 | 699 |
|
697 | | - response = await operation.result() |
| 700 | + response = (await operation).result() |
698 | 701 |
|
699 | 702 | # Handle the response |
700 | 703 | print(response) |
@@ -809,7 +812,7 @@ async def delete_client_connector_service( |
809 | 812 | *, |
810 | 813 | name: Optional[str] = None, |
811 | 814 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
812 | | - timeout: Optional[float] = None, |
| 815 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
813 | 816 | metadata: Sequence[Tuple[str, str]] = (), |
814 | 817 | ) -> operation_async.AsyncOperation: |
815 | 818 | r"""Deletes a single ClientConnectorService. |
@@ -839,7 +842,7 @@ async def sample_delete_client_connector_service(): |
839 | 842 |
|
840 | 843 | print("Waiting for operation to complete...") |
841 | 844 |
|
842 | | - response = await operation.result() |
| 845 | + response = (await operation).result() |
843 | 846 |
|
844 | 847 | # Handle the response |
845 | 848 | print(response) |
@@ -932,7 +935,7 @@ async def list_operations( |
932 | 935 | request: Optional[operations_pb2.ListOperationsRequest] = None, |
933 | 936 | *, |
934 | 937 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
935 | | - timeout: Optional[float] = None, |
| 938 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
936 | 939 | metadata: Sequence[Tuple[str, str]] = (), |
937 | 940 | ) -> operations_pb2.ListOperationsResponse: |
938 | 941 | r"""Lists operations that match the specified filter in the request. |
@@ -986,7 +989,7 @@ async def get_operation( |
986 | 989 | request: Optional[operations_pb2.GetOperationRequest] = None, |
987 | 990 | *, |
988 | 991 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
989 | | - timeout: Optional[float] = None, |
| 992 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
990 | 993 | metadata: Sequence[Tuple[str, str]] = (), |
991 | 994 | ) -> operations_pb2.Operation: |
992 | 995 | r"""Gets the latest state of a long-running operation. |
@@ -1040,7 +1043,7 @@ async def delete_operation( |
1040 | 1043 | request: Optional[operations_pb2.DeleteOperationRequest] = None, |
1041 | 1044 | *, |
1042 | 1045 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
1043 | | - timeout: Optional[float] = None, |
| 1046 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1044 | 1047 | metadata: Sequence[Tuple[str, str]] = (), |
1045 | 1048 | ) -> None: |
1046 | 1049 | r"""Deletes a long-running operation. |
@@ -1095,7 +1098,7 @@ async def cancel_operation( |
1095 | 1098 | request: Optional[operations_pb2.CancelOperationRequest] = None, |
1096 | 1099 | *, |
1097 | 1100 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
1098 | | - timeout: Optional[float] = None, |
| 1101 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1099 | 1102 | metadata: Sequence[Tuple[str, str]] = (), |
1100 | 1103 | ) -> None: |
1101 | 1104 | r"""Starts asynchronous cancellation on a long-running operation. |
@@ -1149,7 +1152,7 @@ async def set_iam_policy( |
1149 | 1152 | request: Optional[iam_policy_pb2.SetIamPolicyRequest] = None, |
1150 | 1153 | *, |
1151 | 1154 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
1152 | | - timeout: Optional[float] = None, |
| 1155 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1153 | 1156 | metadata: Sequence[Tuple[str, str]] = (), |
1154 | 1157 | ) -> policy_pb2.Policy: |
1155 | 1158 | r"""Sets the IAM access control policy on the specified function. |
@@ -1269,7 +1272,7 @@ async def get_iam_policy( |
1269 | 1272 | request: Optional[iam_policy_pb2.GetIamPolicyRequest] = None, |
1270 | 1273 | *, |
1271 | 1274 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
1272 | | - timeout: Optional[float] = None, |
| 1275 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1273 | 1276 | metadata: Sequence[Tuple[str, str]] = (), |
1274 | 1277 | ) -> policy_pb2.Policy: |
1275 | 1278 | r"""Gets the IAM access control policy for a function. |
@@ -1390,7 +1393,7 @@ async def test_iam_permissions( |
1390 | 1393 | request: Optional[iam_policy_pb2.TestIamPermissionsRequest] = None, |
1391 | 1394 | *, |
1392 | 1395 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
1393 | | - timeout: Optional[float] = None, |
| 1396 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1394 | 1397 | metadata: Sequence[Tuple[str, str]] = (), |
1395 | 1398 | ) -> iam_policy_pb2.TestIamPermissionsResponse: |
1396 | 1399 | r"""Tests the specified IAM permissions against the IAM access control |
@@ -1449,7 +1452,7 @@ async def get_location( |
1449 | 1452 | request: Optional[locations_pb2.GetLocationRequest] = None, |
1450 | 1453 | *, |
1451 | 1454 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
1452 | | - timeout: Optional[float] = None, |
| 1455 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1453 | 1456 | metadata: Sequence[Tuple[str, str]] = (), |
1454 | 1457 | ) -> locations_pb2.Location: |
1455 | 1458 | r"""Gets information about a location. |
@@ -1503,7 +1506,7 @@ async def list_locations( |
1503 | 1506 | request: Optional[locations_pb2.ListLocationsRequest] = None, |
1504 | 1507 | *, |
1505 | 1508 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
1506 | | - timeout: Optional[float] = None, |
| 1509 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1507 | 1510 | metadata: Sequence[Tuple[str, str]] = (), |
1508 | 1511 | ) -> locations_pb2.ListLocationsResponse: |
1509 | 1512 | r"""Lists information about the supported locations for this service. |
@@ -1559,14 +1562,9 @@ async def __aexit__(self, exc_type, exc, tb): |
1559 | 1562 | await self.transport.close() |
1560 | 1563 |
|
1561 | 1564 |
|
1562 | | -try: |
1563 | | - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( |
1564 | | - gapic_version=pkg_resources.get_distribution( |
1565 | | - "google-cloud-beyondcorp-clientconnectorservices", |
1566 | | - ).version, |
1567 | | - ) |
1568 | | -except pkg_resources.DistributionNotFound: |
1569 | | - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() |
| 1565 | +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( |
| 1566 | + gapic_version=package_version.__version__ |
| 1567 | +) |
1570 | 1568 |
|
1571 | 1569 |
|
1572 | 1570 | __all__ = ("ClientConnectorServicesServiceAsyncClient",) |
0 commit comments