Skip to content
This repository was archived by the owner on Nov 29, 2023. It is now read-only.

Commit c9ff564

Browse files
fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#323)
* fix(deps): Require google-api-core >=1.34.0, >=2.11.0 fix: Drop usage of pkg_resources fix: Fix timeout default values docs(samples): Snippetgen should call await on the operation coroutine before calling result PiperOrigin-RevId: 493260409 Source-Link: googleapis/googleapis@fea4387 Source-Link: https://github.com/googleapis/googleapis-gen/commit/387b7344c7529ee44be84e613b19a820508c612b Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMzg3YjczNDRjNzUyOWVlNDRiZTg0ZTYxM2IxOWE4MjA1MDhjNjEyYiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * add gapic_version.py Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent bc7eab0 commit c9ff564

File tree

8 files changed

+75
-76
lines changed

8 files changed

+75
-76
lines changed

.coveragerc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,3 @@ exclude_lines =
1010
pragma: NO COVER
1111
# Ignore debug-only repr
1212
def __repr__
13-
# Ignore pkg_resources exceptions.
14-
# This is added at the module level as a safeguard for if someone
15-
# generates the code and tries to run it without pip installing. This
16-
# makes it virtually impossible to test properly.
17-
except pkg_resources.DistributionNotFound
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2022 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
__version__ = "1.7.3" # {x-release-please-version}

google/cloud/bigquery_reservation_v1/services/reservation_service/async_client.py

Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
from google.api_core.client_options import ClientOptions
3636
from google.auth import credentials as ga_credentials # type: ignore
3737
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
3940

4041
try:
4142
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -261,7 +262,7 @@ async def create_reservation(
261262
reservation: Optional[gcbr_reservation.Reservation] = None,
262263
reservation_id: Optional[str] = None,
263264
retry: OptionalRetry = gapic_v1.method.DEFAULT,
264-
timeout: Optional[float] = None,
265+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
265266
metadata: Sequence[Tuple[str, str]] = (),
266267
) -> gcbr_reservation.Reservation:
267268
r"""Creates a new reservation resource.
@@ -384,7 +385,7 @@ async def list_reservations(
384385
*,
385386
parent: Optional[str] = None,
386387
retry: OptionalRetry = gapic_v1.method.DEFAULT,
387-
timeout: Optional[float] = None,
388+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
388389
metadata: Sequence[Tuple[str, str]] = (),
389390
) -> pagers.ListReservationsAsyncPager:
390391
r"""Lists all the reservations for the project in the
@@ -510,7 +511,7 @@ async def get_reservation(
510511
*,
511512
name: Optional[str] = None,
512513
retry: OptionalRetry = gapic_v1.method.DEFAULT,
513-
timeout: Optional[float] = None,
514+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
514515
metadata: Sequence[Tuple[str, str]] = (),
515516
) -> reservation.Reservation:
516517
r"""Returns information about the reservation.
@@ -623,7 +624,7 @@ async def delete_reservation(
623624
*,
624625
name: Optional[str] = None,
625626
retry: OptionalRetry = gapic_v1.method.DEFAULT,
626-
timeout: Optional[float] = None,
627+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
627628
metadata: Sequence[Tuple[str, str]] = (),
628629
) -> None:
629630
r"""Deletes a reservation. Returns
@@ -729,7 +730,7 @@ async def update_reservation(
729730
reservation: Optional[gcbr_reservation.Reservation] = None,
730731
update_mask: Optional[field_mask_pb2.FieldMask] = None,
731732
retry: OptionalRetry = gapic_v1.method.DEFAULT,
732-
timeout: Optional[float] = None,
733+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
733734
metadata: Sequence[Tuple[str, str]] = (),
734735
) -> gcbr_reservation.Reservation:
735736
r"""Updates an existing reservation resource.
@@ -842,7 +843,7 @@ async def create_capacity_commitment(
842843
parent: Optional[str] = None,
843844
capacity_commitment: Optional[reservation.CapacityCommitment] = None,
844845
retry: OptionalRetry = gapic_v1.method.DEFAULT,
845-
timeout: Optional[float] = None,
846+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
846847
metadata: Sequence[Tuple[str, str]] = (),
847848
) -> reservation.CapacityCommitment:
848849
r"""Creates a new capacity commitment resource.
@@ -967,7 +968,7 @@ async def list_capacity_commitments(
967968
*,
968969
parent: Optional[str] = None,
969970
retry: OptionalRetry = gapic_v1.method.DEFAULT,
970-
timeout: Optional[float] = None,
971+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
971972
metadata: Sequence[Tuple[str, str]] = (),
972973
) -> pagers.ListCapacityCommitmentsAsyncPager:
973974
r"""Lists all the capacity commitments for the admin
@@ -1093,7 +1094,7 @@ async def get_capacity_commitment(
10931094
*,
10941095
name: Optional[str] = None,
10951096
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1096-
timeout: Optional[float] = None,
1097+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
10971098
metadata: Sequence[Tuple[str, str]] = (),
10981099
) -> reservation.CapacityCommitment:
10991100
r"""Returns information about the capacity commitment.
@@ -1220,7 +1221,7 @@ async def delete_capacity_commitment(
12201221
*,
12211222
name: Optional[str] = None,
12221223
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1223-
timeout: Optional[float] = None,
1224+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
12241225
metadata: Sequence[Tuple[str, str]] = (),
12251226
) -> None:
12261227
r"""Deletes a capacity commitment. Attempting to delete capacity
@@ -1326,7 +1327,7 @@ async def update_capacity_commitment(
13261327
capacity_commitment: Optional[reservation.CapacityCommitment] = None,
13271328
update_mask: Optional[field_mask_pb2.FieldMask] = None,
13281329
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1329-
timeout: Optional[float] = None,
1330+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
13301331
metadata: Sequence[Tuple[str, str]] = (),
13311332
) -> reservation.CapacityCommitment:
13321333
r"""Updates an existing capacity commitment.
@@ -1460,7 +1461,7 @@ async def split_capacity_commitment(
14601461
name: Optional[str] = None,
14611462
slot_count: Optional[int] = None,
14621463
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1463-
timeout: Optional[float] = None,
1464+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
14641465
metadata: Sequence[Tuple[str, str]] = (),
14651466
) -> reservation.SplitCapacityCommitmentResponse:
14661467
r"""Splits capacity commitment to two commitments of the same plan
@@ -1582,7 +1583,7 @@ async def merge_capacity_commitments(
15821583
parent: Optional[str] = None,
15831584
capacity_commitment_ids: Optional[MutableSequence[str]] = None,
15841585
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1585-
timeout: Optional[float] = None,
1586+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
15861587
metadata: Sequence[Tuple[str, str]] = (),
15871588
) -> reservation.CapacityCommitment:
15881589
r"""Merges capacity commitments of the same plan into a single
@@ -1719,7 +1720,7 @@ async def create_assignment(
17191720
parent: Optional[str] = None,
17201721
assignment: Optional[reservation.Assignment] = None,
17211722
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1722-
timeout: Optional[float] = None,
1723+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
17231724
metadata: Sequence[Tuple[str, str]] = (),
17241725
) -> reservation.Assignment:
17251726
r"""Creates an assignment object which allows the given project to
@@ -1869,7 +1870,7 @@ async def list_assignments(
18691870
*,
18701871
parent: Optional[str] = None,
18711872
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1872-
timeout: Optional[float] = None,
1873+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
18731874
metadata: Sequence[Tuple[str, str]] = (),
18741875
) -> pagers.ListAssignmentsAsyncPager:
18751876
r"""Lists assignments.
@@ -2020,7 +2021,7 @@ async def delete_assignment(
20202021
*,
20212022
name: Optional[str] = None,
20222023
retry: OptionalRetry = gapic_v1.method.DEFAULT,
2023-
timeout: Optional[float] = None,
2024+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
20242025
metadata: Sequence[Tuple[str, str]] = (),
20252026
) -> None:
20262027
r"""Deletes a assignment. No expansion will happen.
@@ -2138,7 +2139,7 @@ async def search_assignments(
21382139
parent: Optional[str] = None,
21392140
query: Optional[str] = None,
21402141
retry: OptionalRetry = gapic_v1.method.DEFAULT,
2141-
timeout: Optional[float] = None,
2142+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
21422143
metadata: Sequence[Tuple[str, str]] = (),
21432144
) -> pagers.SearchAssignmentsAsyncPager:
21442145
r"""Deprecated: Looks up assignments for a specified resource for a
@@ -2310,7 +2311,7 @@ async def search_all_assignments(
23102311
parent: Optional[str] = None,
23112312
query: Optional[str] = None,
23122313
retry: OptionalRetry = gapic_v1.method.DEFAULT,
2313-
timeout: Optional[float] = None,
2314+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
23142315
metadata: Sequence[Tuple[str, str]] = (),
23152316
) -> pagers.SearchAllAssignmentsAsyncPager:
23162317
r"""Looks up assignments for a specified resource for a particular
@@ -2465,7 +2466,7 @@ async def move_assignment(
24652466
name: Optional[str] = None,
24662467
destination_id: Optional[str] = None,
24672468
retry: OptionalRetry = gapic_v1.method.DEFAULT,
2468-
timeout: Optional[float] = None,
2469+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
24692470
metadata: Sequence[Tuple[str, str]] = (),
24702471
) -> reservation.Assignment:
24712472
r"""Moves an assignment under a new reservation.
@@ -2588,7 +2589,7 @@ async def update_assignment(
25882589
assignment: Optional[reservation.Assignment] = None,
25892590
update_mask: Optional[field_mask_pb2.FieldMask] = None,
25902591
retry: OptionalRetry = gapic_v1.method.DEFAULT,
2591-
timeout: Optional[float] = None,
2592+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
25922593
metadata: Sequence[Tuple[str, str]] = (),
25932594
) -> reservation.Assignment:
25942595
r"""Updates an existing assignment.
@@ -2701,7 +2702,7 @@ async def get_bi_reservation(
27012702
*,
27022703
name: Optional[str] = None,
27032704
retry: OptionalRetry = gapic_v1.method.DEFAULT,
2704-
timeout: Optional[float] = None,
2705+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
27052706
metadata: Sequence[Tuple[str, str]] = (),
27062707
) -> reservation.BiReservation:
27072708
r"""Retrieves a BI reservation.
@@ -2813,7 +2814,7 @@ async def update_bi_reservation(
28132814
bi_reservation: Optional[reservation.BiReservation] = None,
28142815
update_mask: Optional[field_mask_pb2.FieldMask] = None,
28152816
retry: OptionalRetry = gapic_v1.method.DEFAULT,
2816-
timeout: Optional[float] = None,
2817+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
28172818
metadata: Sequence[Tuple[str, str]] = (),
28182819
) -> reservation.BiReservation:
28192820
r"""Updates a BI reservation.
@@ -2929,14 +2930,9 @@ async def __aexit__(self, exc_type, exc, tb):
29292930
await self.transport.close()
29302931

29312932

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+
)
29402936

29412937

29422938
__all__ = ("ReservationServiceAsyncClient",)

0 commit comments

Comments
 (0)