|
35 | 35 | from google.api_core.client_options import ClientOptions |
36 | 36 | from google.auth import credentials as ga_credentials # type: ignore |
37 | 37 | from google.oauth2 import service_account # type: ignore |
38 | | -import pkg_resources |
| 38 | + |
| 39 | +from google.cloud.bigquery_reservation_v1 import gapic_version as package_version |
39 | 40 |
|
40 | 41 | try: |
41 | 42 | OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] |
@@ -261,7 +262,7 @@ async def create_reservation( |
261 | 262 | reservation: Optional[gcbr_reservation.Reservation] = None, |
262 | 263 | reservation_id: Optional[str] = None, |
263 | 264 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
264 | | - timeout: Optional[float] = None, |
| 265 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
265 | 266 | metadata: Sequence[Tuple[str, str]] = (), |
266 | 267 | ) -> gcbr_reservation.Reservation: |
267 | 268 | r"""Creates a new reservation resource. |
@@ -384,7 +385,7 @@ async def list_reservations( |
384 | 385 | *, |
385 | 386 | parent: Optional[str] = None, |
386 | 387 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
387 | | - timeout: Optional[float] = None, |
| 388 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
388 | 389 | metadata: Sequence[Tuple[str, str]] = (), |
389 | 390 | ) -> pagers.ListReservationsAsyncPager: |
390 | 391 | r"""Lists all the reservations for the project in the |
@@ -510,7 +511,7 @@ async def get_reservation( |
510 | 511 | *, |
511 | 512 | name: Optional[str] = None, |
512 | 513 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
513 | | - timeout: Optional[float] = None, |
| 514 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
514 | 515 | metadata: Sequence[Tuple[str, str]] = (), |
515 | 516 | ) -> reservation.Reservation: |
516 | 517 | r"""Returns information about the reservation. |
@@ -623,7 +624,7 @@ async def delete_reservation( |
623 | 624 | *, |
624 | 625 | name: Optional[str] = None, |
625 | 626 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
626 | | - timeout: Optional[float] = None, |
| 627 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
627 | 628 | metadata: Sequence[Tuple[str, str]] = (), |
628 | 629 | ) -> None: |
629 | 630 | r"""Deletes a reservation. Returns |
@@ -729,7 +730,7 @@ async def update_reservation( |
729 | 730 | reservation: Optional[gcbr_reservation.Reservation] = None, |
730 | 731 | update_mask: Optional[field_mask_pb2.FieldMask] = None, |
731 | 732 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
732 | | - timeout: Optional[float] = None, |
| 733 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
733 | 734 | metadata: Sequence[Tuple[str, str]] = (), |
734 | 735 | ) -> gcbr_reservation.Reservation: |
735 | 736 | r"""Updates an existing reservation resource. |
@@ -842,7 +843,7 @@ async def create_capacity_commitment( |
842 | 843 | parent: Optional[str] = None, |
843 | 844 | capacity_commitment: Optional[reservation.CapacityCommitment] = None, |
844 | 845 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
845 | | - timeout: Optional[float] = None, |
| 846 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
846 | 847 | metadata: Sequence[Tuple[str, str]] = (), |
847 | 848 | ) -> reservation.CapacityCommitment: |
848 | 849 | r"""Creates a new capacity commitment resource. |
@@ -967,7 +968,7 @@ async def list_capacity_commitments( |
967 | 968 | *, |
968 | 969 | parent: Optional[str] = None, |
969 | 970 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
970 | | - timeout: Optional[float] = None, |
| 971 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
971 | 972 | metadata: Sequence[Tuple[str, str]] = (), |
972 | 973 | ) -> pagers.ListCapacityCommitmentsAsyncPager: |
973 | 974 | r"""Lists all the capacity commitments for the admin |
@@ -1093,7 +1094,7 @@ async def get_capacity_commitment( |
1093 | 1094 | *, |
1094 | 1095 | name: Optional[str] = None, |
1095 | 1096 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
1096 | | - timeout: Optional[float] = None, |
| 1097 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1097 | 1098 | metadata: Sequence[Tuple[str, str]] = (), |
1098 | 1099 | ) -> reservation.CapacityCommitment: |
1099 | 1100 | r"""Returns information about the capacity commitment. |
@@ -1220,7 +1221,7 @@ async def delete_capacity_commitment( |
1220 | 1221 | *, |
1221 | 1222 | name: Optional[str] = None, |
1222 | 1223 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
1223 | | - timeout: Optional[float] = None, |
| 1224 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1224 | 1225 | metadata: Sequence[Tuple[str, str]] = (), |
1225 | 1226 | ) -> None: |
1226 | 1227 | r"""Deletes a capacity commitment. Attempting to delete capacity |
@@ -1326,7 +1327,7 @@ async def update_capacity_commitment( |
1326 | 1327 | capacity_commitment: Optional[reservation.CapacityCommitment] = None, |
1327 | 1328 | update_mask: Optional[field_mask_pb2.FieldMask] = None, |
1328 | 1329 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
1329 | | - timeout: Optional[float] = None, |
| 1330 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1330 | 1331 | metadata: Sequence[Tuple[str, str]] = (), |
1331 | 1332 | ) -> reservation.CapacityCommitment: |
1332 | 1333 | r"""Updates an existing capacity commitment. |
@@ -1460,7 +1461,7 @@ async def split_capacity_commitment( |
1460 | 1461 | name: Optional[str] = None, |
1461 | 1462 | slot_count: Optional[int] = None, |
1462 | 1463 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
1463 | | - timeout: Optional[float] = None, |
| 1464 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1464 | 1465 | metadata: Sequence[Tuple[str, str]] = (), |
1465 | 1466 | ) -> reservation.SplitCapacityCommitmentResponse: |
1466 | 1467 | r"""Splits capacity commitment to two commitments of the same plan |
@@ -1582,7 +1583,7 @@ async def merge_capacity_commitments( |
1582 | 1583 | parent: Optional[str] = None, |
1583 | 1584 | capacity_commitment_ids: Optional[MutableSequence[str]] = None, |
1584 | 1585 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
1585 | | - timeout: Optional[float] = None, |
| 1586 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1586 | 1587 | metadata: Sequence[Tuple[str, str]] = (), |
1587 | 1588 | ) -> reservation.CapacityCommitment: |
1588 | 1589 | r"""Merges capacity commitments of the same plan into a single |
@@ -1719,7 +1720,7 @@ async def create_assignment( |
1719 | 1720 | parent: Optional[str] = None, |
1720 | 1721 | assignment: Optional[reservation.Assignment] = None, |
1721 | 1722 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
1722 | | - timeout: Optional[float] = None, |
| 1723 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1723 | 1724 | metadata: Sequence[Tuple[str, str]] = (), |
1724 | 1725 | ) -> reservation.Assignment: |
1725 | 1726 | r"""Creates an assignment object which allows the given project to |
@@ -1869,7 +1870,7 @@ async def list_assignments( |
1869 | 1870 | *, |
1870 | 1871 | parent: Optional[str] = None, |
1871 | 1872 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
1872 | | - timeout: Optional[float] = None, |
| 1873 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1873 | 1874 | metadata: Sequence[Tuple[str, str]] = (), |
1874 | 1875 | ) -> pagers.ListAssignmentsAsyncPager: |
1875 | 1876 | r"""Lists assignments. |
@@ -2020,7 +2021,7 @@ async def delete_assignment( |
2020 | 2021 | *, |
2021 | 2022 | name: Optional[str] = None, |
2022 | 2023 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
2023 | | - timeout: Optional[float] = None, |
| 2024 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
2024 | 2025 | metadata: Sequence[Tuple[str, str]] = (), |
2025 | 2026 | ) -> None: |
2026 | 2027 | r"""Deletes a assignment. No expansion will happen. |
@@ -2138,7 +2139,7 @@ async def search_assignments( |
2138 | 2139 | parent: Optional[str] = None, |
2139 | 2140 | query: Optional[str] = None, |
2140 | 2141 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
2141 | | - timeout: Optional[float] = None, |
| 2142 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
2142 | 2143 | metadata: Sequence[Tuple[str, str]] = (), |
2143 | 2144 | ) -> pagers.SearchAssignmentsAsyncPager: |
2144 | 2145 | r"""Deprecated: Looks up assignments for a specified resource for a |
@@ -2310,7 +2311,7 @@ async def search_all_assignments( |
2310 | 2311 | parent: Optional[str] = None, |
2311 | 2312 | query: Optional[str] = None, |
2312 | 2313 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
2313 | | - timeout: Optional[float] = None, |
| 2314 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
2314 | 2315 | metadata: Sequence[Tuple[str, str]] = (), |
2315 | 2316 | ) -> pagers.SearchAllAssignmentsAsyncPager: |
2316 | 2317 | r"""Looks up assignments for a specified resource for a particular |
@@ -2465,7 +2466,7 @@ async def move_assignment( |
2465 | 2466 | name: Optional[str] = None, |
2466 | 2467 | destination_id: Optional[str] = None, |
2467 | 2468 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
2468 | | - timeout: Optional[float] = None, |
| 2469 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
2469 | 2470 | metadata: Sequence[Tuple[str, str]] = (), |
2470 | 2471 | ) -> reservation.Assignment: |
2471 | 2472 | r"""Moves an assignment under a new reservation. |
@@ -2588,7 +2589,7 @@ async def update_assignment( |
2588 | 2589 | assignment: Optional[reservation.Assignment] = None, |
2589 | 2590 | update_mask: Optional[field_mask_pb2.FieldMask] = None, |
2590 | 2591 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
2591 | | - timeout: Optional[float] = None, |
| 2592 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
2592 | 2593 | metadata: Sequence[Tuple[str, str]] = (), |
2593 | 2594 | ) -> reservation.Assignment: |
2594 | 2595 | r"""Updates an existing assignment. |
@@ -2701,7 +2702,7 @@ async def get_bi_reservation( |
2701 | 2702 | *, |
2702 | 2703 | name: Optional[str] = None, |
2703 | 2704 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
2704 | | - timeout: Optional[float] = None, |
| 2705 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
2705 | 2706 | metadata: Sequence[Tuple[str, str]] = (), |
2706 | 2707 | ) -> reservation.BiReservation: |
2707 | 2708 | r"""Retrieves a BI reservation. |
@@ -2813,7 +2814,7 @@ async def update_bi_reservation( |
2813 | 2814 | bi_reservation: Optional[reservation.BiReservation] = None, |
2814 | 2815 | update_mask: Optional[field_mask_pb2.FieldMask] = None, |
2815 | 2816 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
2816 | | - timeout: Optional[float] = None, |
| 2817 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
2817 | 2818 | metadata: Sequence[Tuple[str, str]] = (), |
2818 | 2819 | ) -> reservation.BiReservation: |
2819 | 2820 | r"""Updates a BI reservation. |
@@ -2929,14 +2930,9 @@ async def __aexit__(self, exc_type, exc, tb): |
2929 | 2930 | await self.transport.close() |
2930 | 2931 |
|
2931 | 2932 |
|
2932 | | -try: |
2933 | | - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( |
2934 | | - gapic_version=pkg_resources.get_distribution( |
2935 | | - "google-cloud-bigquery-reservation", |
2936 | | - ).version, |
2937 | | - ) |
2938 | | -except pkg_resources.DistributionNotFound: |
2939 | | - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() |
| 2933 | +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( |
| 2934 | + gapic_version=package_version.__version__ |
| 2935 | +) |
2940 | 2936 |
|
2941 | 2937 |
|
2942 | 2938 | __all__ = ("ReservationServiceAsyncClient",) |
0 commit comments