Skip to content

Commit 626710f

Browse files
fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#667)
* 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: googleapis/googleapis-gen@387b734 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMzg3YjczNDRjNzUyOWVlNDRiZTg0ZTYxM2IxOWE4MjA1MDhjNjEyYiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix(deps): require google-api-core>=1.34.0,>=2.11.0 * add gapic_version.py * update release-please-config.json Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <[email protected]>
1 parent a2bdb14 commit 626710f

File tree

10 files changed

+127
-134
lines changed

10 files changed

+127
-134
lines changed
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__ = "2.7.2" # {x-release-please-version}

google/cloud/firestore_admin_v1/services/firestore_admin/async_client.py

Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
Type,
2828
Union,
2929
)
30-
import pkg_resources
30+
31+
from google.cloud.firestore_admin_v1 import gapic_version as package_version
3132

3233
from google.api_core.client_options import ClientOptions
3334
from google.api_core import exceptions as core_exceptions
@@ -271,7 +272,7 @@ async def create_index(
271272
parent: Optional[str] = None,
272273
index: Optional[gfa_index.Index] = None,
273274
retry: OptionalRetry = gapic_v1.method.DEFAULT,
274-
timeout: Optional[float] = None,
275+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
275276
metadata: Sequence[Tuple[str, str]] = (),
276277
) -> operation_async.AsyncOperation:
277278
r"""Creates a composite index. This returns a
@@ -305,7 +306,7 @@ async def sample_create_index():
305306
306307
print("Waiting for operation to complete...")
307308
308-
response = await operation.result()
309+
response = (await operation).result()
309310
310311
# Handle the response
311312
print(response)
@@ -400,7 +401,7 @@ async def list_indexes(
400401
*,
401402
parent: Optional[str] = None,
402403
retry: OptionalRetry = gapic_v1.method.DEFAULT,
403-
timeout: Optional[float] = None,
404+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
404405
metadata: Sequence[Tuple[str, str]] = (),
405406
) -> pagers.ListIndexesAsyncPager:
406407
r"""Lists composite indexes.
@@ -526,7 +527,7 @@ async def get_index(
526527
*,
527528
name: Optional[str] = None,
528529
retry: OptionalRetry = gapic_v1.method.DEFAULT,
529-
timeout: Optional[float] = None,
530+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
530531
metadata: Sequence[Tuple[str, str]] = (),
531532
) -> index.Index:
532533
r"""Gets a composite index.
@@ -640,7 +641,7 @@ async def delete_index(
640641
*,
641642
name: Optional[str] = None,
642643
retry: OptionalRetry = gapic_v1.method.DEFAULT,
643-
timeout: Optional[float] = None,
644+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
644645
metadata: Sequence[Tuple[str, str]] = (),
645646
) -> None:
646647
r"""Deletes a composite index.
@@ -741,7 +742,7 @@ async def get_field(
741742
*,
742743
name: Optional[str] = None,
743744
retry: OptionalRetry = gapic_v1.method.DEFAULT,
744-
timeout: Optional[float] = None,
745+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
745746
metadata: Sequence[Tuple[str, str]] = (),
746747
) -> field.Field:
747748
r"""Gets the metadata and configuration for a Field.
@@ -857,7 +858,7 @@ async def update_field(
857858
*,
858859
field: Optional[gfa_field.Field] = None,
859860
retry: OptionalRetry = gapic_v1.method.DEFAULT,
860-
timeout: Optional[float] = None,
861+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
861862
metadata: Sequence[Tuple[str, str]] = (),
862863
) -> operation_async.AsyncOperation:
863864
r"""Updates a field configuration. Currently, field updates apply
@@ -905,7 +906,7 @@ async def sample_update_field():
905906
906907
print("Waiting for operation to complete...")
907908
908-
response = await operation.result()
909+
response = (await operation).result()
909910
910911
# Handle the response
911912
print(response)
@@ -996,7 +997,7 @@ async def list_fields(
996997
*,
997998
parent: Optional[str] = None,
998999
retry: OptionalRetry = gapic_v1.method.DEFAULT,
999-
timeout: Optional[float] = None,
1000+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
10001001
metadata: Sequence[Tuple[str, str]] = (),
10011002
) -> pagers.ListFieldsAsyncPager:
10021003
r"""Lists the field configuration and metadata for this database.
@@ -1130,7 +1131,7 @@ async def export_documents(
11301131
*,
11311132
name: Optional[str] = None,
11321133
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1133-
timeout: Optional[float] = None,
1134+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
11341135
metadata: Sequence[Tuple[str, str]] = (),
11351136
) -> operation_async.AsyncOperation:
11361137
r"""Exports a copy of all or a subset of documents from
@@ -1173,7 +1174,7 @@ async def sample_export_documents():
11731174
11741175
print("Waiting for operation to complete...")
11751176
1176-
response = await operation.result()
1177+
response = (await operation).result()
11771178
11781179
# Handle the response
11791180
print(response)
@@ -1262,7 +1263,7 @@ async def import_documents(
12621263
*,
12631264
name: Optional[str] = None,
12641265
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1265-
timeout: Optional[float] = None,
1266+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
12661267
metadata: Sequence[Tuple[str, str]] = (),
12671268
) -> operation_async.AsyncOperation:
12681269
r"""Imports documents into Google Cloud Firestore.
@@ -1298,7 +1299,7 @@ async def sample_import_documents():
12981299
12991300
print("Waiting for operation to complete...")
13001301
1301-
response = await operation.result()
1302+
response = (await operation).result()
13021303
13031304
# Handle the response
13041305
print(response)
@@ -1392,7 +1393,7 @@ async def get_database(
13921393
*,
13931394
name: Optional[str] = None,
13941395
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1395-
timeout: Optional[float] = None,
1396+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
13961397
metadata: Sequence[Tuple[str, str]] = (),
13971398
) -> database.Database:
13981399
r"""Gets information about a database.
@@ -1496,7 +1497,7 @@ async def list_databases(
14961497
*,
14971498
parent: Optional[str] = None,
14981499
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1499-
timeout: Optional[float] = None,
1500+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
15001501
metadata: Sequence[Tuple[str, str]] = (),
15011502
) -> firestore_admin.ListDatabasesResponse:
15021503
r"""List all the databases in the project.
@@ -1597,7 +1598,7 @@ async def update_database(
15971598
database: Optional[gfa_database.Database] = None,
15981599
update_mask: Optional[field_mask_pb2.FieldMask] = None,
15991600
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1600-
timeout: Optional[float] = None,
1601+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
16011602
metadata: Sequence[Tuple[str, str]] = (),
16021603
) -> operation_async.AsyncOperation:
16031604
r"""Updates a database.
@@ -1626,7 +1627,7 @@ async def sample_update_database():
16261627
16271628
print("Waiting for operation to complete...")
16281629
1629-
response = await operation.result()
1630+
response = (await operation).result()
16301631
16311632
# Handle the response
16321633
print(response)
@@ -1720,7 +1721,7 @@ async def list_operations(
17201721
request: Optional[operations_pb2.ListOperationsRequest] = None,
17211722
*,
17221723
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1723-
timeout: Optional[float] = None,
1724+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
17241725
metadata: Sequence[Tuple[str, str]] = (),
17251726
) -> operations_pb2.ListOperationsResponse:
17261727
r"""Lists operations that match the specified filter in the request.
@@ -1774,7 +1775,7 @@ async def get_operation(
17741775
request: Optional[operations_pb2.GetOperationRequest] = None,
17751776
*,
17761777
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1777-
timeout: Optional[float] = None,
1778+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
17781779
metadata: Sequence[Tuple[str, str]] = (),
17791780
) -> operations_pb2.Operation:
17801781
r"""Gets the latest state of a long-running operation.
@@ -1828,7 +1829,7 @@ async def delete_operation(
18281829
request: Optional[operations_pb2.DeleteOperationRequest] = None,
18291830
*,
18301831
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1831-
timeout: Optional[float] = None,
1832+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
18321833
metadata: Sequence[Tuple[str, str]] = (),
18331834
) -> None:
18341835
r"""Deletes a long-running operation.
@@ -1883,7 +1884,7 @@ async def cancel_operation(
18831884
request: Optional[operations_pb2.CancelOperationRequest] = None,
18841885
*,
18851886
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1886-
timeout: Optional[float] = None,
1887+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
18871888
metadata: Sequence[Tuple[str, str]] = (),
18881889
) -> None:
18891890
r"""Starts asynchronous cancellation on a long-running operation.
@@ -1939,14 +1940,9 @@ async def __aexit__(self, exc_type, exc, tb):
19391940
await self.transport.close()
19401941

19411942

1942-
try:
1943-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1944-
gapic_version=pkg_resources.get_distribution(
1945-
"google-cloud-firestore-admin",
1946-
).version,
1947-
)
1948-
except pkg_resources.DistributionNotFound:
1949-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
1943+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1944+
gapic_version=package_version.__version__
1945+
)
19501946

19511947

19521948
__all__ = ("FirestoreAdminAsyncClient",)

0 commit comments

Comments
 (0)