Skip to content

Commit 1e3d54e

Browse files
fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#42)
* 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 * 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 21f847b commit 1e3d54e

File tree

12 files changed

+74
-68
lines changed

12 files changed

+74
-68
lines changed

packages/google-cloud-beyondcorp-clientconnectorservices/.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
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__ = "0.2.2" # {x-release-please-version}

packages/google-cloud-beyondcorp-clientconnectorservices/google/cloud/beyondcorp_clientconnectorservices_v1/services/client_connector_services_service/async_client.py

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@
3434
from google.api_core.client_options import ClientOptions
3535
from google.auth import credentials as ga_credentials # type: ignore
3636
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+
)
3841

3942
try:
4043
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -263,7 +266,7 @@ async def list_client_connector_services(
263266
*,
264267
parent: Optional[str] = None,
265268
retry: OptionalRetry = gapic_v1.method.DEFAULT,
266-
timeout: Optional[float] = None,
269+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
267270
metadata: Sequence[Tuple[str, str]] = (),
268271
) -> pagers.ListClientConnectorServicesAsyncPager:
269272
r"""Lists ClientConnectorServices in a given project and
@@ -385,7 +388,7 @@ async def get_client_connector_service(
385388
*,
386389
name: Optional[str] = None,
387390
retry: OptionalRetry = gapic_v1.method.DEFAULT,
388-
timeout: Optional[float] = None,
391+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
389392
metadata: Sequence[Tuple[str, str]] = (),
390393
) -> client_connector_services_service.ClientConnectorService:
391394
r"""Gets details of a single ClientConnectorService.
@@ -496,7 +499,7 @@ async def create_client_connector_service(
496499
] = None,
497500
client_connector_service_id: Optional[str] = None,
498501
retry: OptionalRetry = gapic_v1.method.DEFAULT,
499-
timeout: Optional[float] = None,
502+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
500503
metadata: Sequence[Tuple[str, str]] = (),
501504
) -> operation_async.AsyncOperation:
502505
r"""Creates a new ClientConnectorService in a given
@@ -535,7 +538,7 @@ async def sample_create_client_connector_service():
535538
536539
print("Waiting for operation to complete...")
537540
538-
response = await operation.result()
541+
response = (await operation).result()
539542
540543
# Handle the response
541544
print(response)
@@ -656,7 +659,7 @@ async def update_client_connector_service(
656659
] = None,
657660
update_mask: Optional[field_mask_pb2.FieldMask] = None,
658661
retry: OptionalRetry = gapic_v1.method.DEFAULT,
659-
timeout: Optional[float] = None,
662+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
660663
metadata: Sequence[Tuple[str, str]] = (),
661664
) -> operation_async.AsyncOperation:
662665
r"""Updates the parameters of a single
@@ -694,7 +697,7 @@ async def sample_update_client_connector_service():
694697
695698
print("Waiting for operation to complete...")
696699
697-
response = await operation.result()
700+
response = (await operation).result()
698701
699702
# Handle the response
700703
print(response)
@@ -809,7 +812,7 @@ async def delete_client_connector_service(
809812
*,
810813
name: Optional[str] = None,
811814
retry: OptionalRetry = gapic_v1.method.DEFAULT,
812-
timeout: Optional[float] = None,
815+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
813816
metadata: Sequence[Tuple[str, str]] = (),
814817
) -> operation_async.AsyncOperation:
815818
r"""Deletes a single ClientConnectorService.
@@ -839,7 +842,7 @@ async def sample_delete_client_connector_service():
839842
840843
print("Waiting for operation to complete...")
841844
842-
response = await operation.result()
845+
response = (await operation).result()
843846
844847
# Handle the response
845848
print(response)
@@ -932,7 +935,7 @@ async def list_operations(
932935
request: Optional[operations_pb2.ListOperationsRequest] = None,
933936
*,
934937
retry: OptionalRetry = gapic_v1.method.DEFAULT,
935-
timeout: Optional[float] = None,
938+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
936939
metadata: Sequence[Tuple[str, str]] = (),
937940
) -> operations_pb2.ListOperationsResponse:
938941
r"""Lists operations that match the specified filter in the request.
@@ -986,7 +989,7 @@ async def get_operation(
986989
request: Optional[operations_pb2.GetOperationRequest] = None,
987990
*,
988991
retry: OptionalRetry = gapic_v1.method.DEFAULT,
989-
timeout: Optional[float] = None,
992+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
990993
metadata: Sequence[Tuple[str, str]] = (),
991994
) -> operations_pb2.Operation:
992995
r"""Gets the latest state of a long-running operation.
@@ -1040,7 +1043,7 @@ async def delete_operation(
10401043
request: Optional[operations_pb2.DeleteOperationRequest] = None,
10411044
*,
10421045
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1043-
timeout: Optional[float] = None,
1046+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
10441047
metadata: Sequence[Tuple[str, str]] = (),
10451048
) -> None:
10461049
r"""Deletes a long-running operation.
@@ -1095,7 +1098,7 @@ async def cancel_operation(
10951098
request: Optional[operations_pb2.CancelOperationRequest] = None,
10961099
*,
10971100
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1098-
timeout: Optional[float] = None,
1101+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
10991102
metadata: Sequence[Tuple[str, str]] = (),
11001103
) -> None:
11011104
r"""Starts asynchronous cancellation on a long-running operation.
@@ -1149,7 +1152,7 @@ async def set_iam_policy(
11491152
request: Optional[iam_policy_pb2.SetIamPolicyRequest] = None,
11501153
*,
11511154
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1152-
timeout: Optional[float] = None,
1155+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
11531156
metadata: Sequence[Tuple[str, str]] = (),
11541157
) -> policy_pb2.Policy:
11551158
r"""Sets the IAM access control policy on the specified function.
@@ -1269,7 +1272,7 @@ async def get_iam_policy(
12691272
request: Optional[iam_policy_pb2.GetIamPolicyRequest] = None,
12701273
*,
12711274
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1272-
timeout: Optional[float] = None,
1275+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
12731276
metadata: Sequence[Tuple[str, str]] = (),
12741277
) -> policy_pb2.Policy:
12751278
r"""Gets the IAM access control policy for a function.
@@ -1390,7 +1393,7 @@ async def test_iam_permissions(
13901393
request: Optional[iam_policy_pb2.TestIamPermissionsRequest] = None,
13911394
*,
13921395
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1393-
timeout: Optional[float] = None,
1396+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
13941397
metadata: Sequence[Tuple[str, str]] = (),
13951398
) -> iam_policy_pb2.TestIamPermissionsResponse:
13961399
r"""Tests the specified IAM permissions against the IAM access control
@@ -1449,7 +1452,7 @@ async def get_location(
14491452
request: Optional[locations_pb2.GetLocationRequest] = None,
14501453
*,
14511454
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1452-
timeout: Optional[float] = None,
1455+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
14531456
metadata: Sequence[Tuple[str, str]] = (),
14541457
) -> locations_pb2.Location:
14551458
r"""Gets information about a location.
@@ -1503,7 +1506,7 @@ async def list_locations(
15031506
request: Optional[locations_pb2.ListLocationsRequest] = None,
15041507
*,
15051508
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1506-
timeout: Optional[float] = None,
1509+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
15071510
metadata: Sequence[Tuple[str, str]] = (),
15081511
) -> locations_pb2.ListLocationsResponse:
15091512
r"""Lists information about the supported locations for this service.
@@ -1559,14 +1562,9 @@ async def __aexit__(self, exc_type, exc, tb):
15591562
await self.transport.close()
15601563

15611564

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

15711569

15721570
__all__ = ("ClientConnectorServicesServiceAsyncClient",)

packages/google-cloud-beyondcorp-clientconnectorservices/google/cloud/beyondcorp_clientconnectorservices_v1/services/client_connector_services_service/client.py

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@
3838
from google.auth.transport import mtls # type: ignore
3939
from google.auth.transport.grpc import SslCredentials # type: ignore
4040
from google.oauth2 import service_account # type: ignore
41-
import pkg_resources
41+
42+
from google.cloud.beyondcorp_clientconnectorservices_v1 import (
43+
gapic_version as package_version,
44+
)
4245

4346
try:
4447
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -485,7 +488,7 @@ def list_client_connector_services(
485488
*,
486489
parent: Optional[str] = None,
487490
retry: OptionalRetry = gapic_v1.method.DEFAULT,
488-
timeout: Optional[float] = None,
491+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
489492
metadata: Sequence[Tuple[str, str]] = (),
490493
) -> pagers.ListClientConnectorServicesPager:
491494
r"""Lists ClientConnectorServices in a given project and
@@ -614,7 +617,7 @@ def get_client_connector_service(
614617
*,
615618
name: Optional[str] = None,
616619
retry: OptionalRetry = gapic_v1.method.DEFAULT,
617-
timeout: Optional[float] = None,
620+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
618621
metadata: Sequence[Tuple[str, str]] = (),
619622
) -> client_connector_services_service.ClientConnectorService:
620623
r"""Gets details of a single ClientConnectorService.
@@ -731,7 +734,7 @@ def create_client_connector_service(
731734
] = None,
732735
client_connector_service_id: Optional[str] = None,
733736
retry: OptionalRetry = gapic_v1.method.DEFAULT,
734-
timeout: Optional[float] = None,
737+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
735738
metadata: Sequence[Tuple[str, str]] = (),
736739
) -> operation.Operation:
737740
r"""Creates a new ClientConnectorService in a given
@@ -898,7 +901,7 @@ def update_client_connector_service(
898901
] = None,
899902
update_mask: Optional[field_mask_pb2.FieldMask] = None,
900903
retry: OptionalRetry = gapic_v1.method.DEFAULT,
901-
timeout: Optional[float] = None,
904+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
902905
metadata: Sequence[Tuple[str, str]] = (),
903906
) -> operation.Operation:
904907
r"""Updates the parameters of a single
@@ -1058,7 +1061,7 @@ def delete_client_connector_service(
10581061
*,
10591062
name: Optional[str] = None,
10601063
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1061-
timeout: Optional[float] = None,
1064+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
10621065
metadata: Sequence[Tuple[str, str]] = (),
10631066
) -> operation.Operation:
10641067
r"""Deletes a single ClientConnectorService.
@@ -1201,7 +1204,7 @@ def list_operations(
12011204
request: Optional[operations_pb2.ListOperationsRequest] = None,
12021205
*,
12031206
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1204-
timeout: Optional[float] = None,
1207+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
12051208
metadata: Sequence[Tuple[str, str]] = (),
12061209
) -> operations_pb2.ListOperationsResponse:
12071210
r"""Lists operations that match the specified filter in the request.
@@ -1255,7 +1258,7 @@ def get_operation(
12551258
request: Optional[operations_pb2.GetOperationRequest] = None,
12561259
*,
12571260
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1258-
timeout: Optional[float] = None,
1261+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
12591262
metadata: Sequence[Tuple[str, str]] = (),
12601263
) -> operations_pb2.Operation:
12611264
r"""Gets the latest state of a long-running operation.
@@ -1309,7 +1312,7 @@ def delete_operation(
13091312
request: Optional[operations_pb2.DeleteOperationRequest] = None,
13101313
*,
13111314
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1312-
timeout: Optional[float] = None,
1315+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
13131316
metadata: Sequence[Tuple[str, str]] = (),
13141317
) -> None:
13151318
r"""Deletes a long-running operation.
@@ -1364,7 +1367,7 @@ def cancel_operation(
13641367
request: Optional[operations_pb2.CancelOperationRequest] = None,
13651368
*,
13661369
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1367-
timeout: Optional[float] = None,
1370+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
13681371
metadata: Sequence[Tuple[str, str]] = (),
13691372
) -> None:
13701373
r"""Starts asynchronous cancellation on a long-running operation.
@@ -1418,7 +1421,7 @@ def set_iam_policy(
14181421
request: Optional[iam_policy_pb2.SetIamPolicyRequest] = None,
14191422
*,
14201423
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1421-
timeout: Optional[float] = None,
1424+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
14221425
metadata: Sequence[Tuple[str, str]] = (),
14231426
) -> policy_pb2.Policy:
14241427
r"""Sets the IAM access control policy on the specified function.
@@ -1538,7 +1541,7 @@ def get_iam_policy(
15381541
request: Optional[iam_policy_pb2.GetIamPolicyRequest] = None,
15391542
*,
15401543
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1541-
timeout: Optional[float] = None,
1544+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
15421545
metadata: Sequence[Tuple[str, str]] = (),
15431546
) -> policy_pb2.Policy:
15441547
r"""Gets the IAM access control policy for a function.
@@ -1659,7 +1662,7 @@ def test_iam_permissions(
16591662
request: Optional[iam_policy_pb2.TestIamPermissionsRequest] = None,
16601663
*,
16611664
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1662-
timeout: Optional[float] = None,
1665+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
16631666
metadata: Sequence[Tuple[str, str]] = (),
16641667
) -> iam_policy_pb2.TestIamPermissionsResponse:
16651668
r"""Tests the specified IAM permissions against the IAM access control
@@ -1718,7 +1721,7 @@ def get_location(
17181721
request: Optional[locations_pb2.GetLocationRequest] = None,
17191722
*,
17201723
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1721-
timeout: Optional[float] = None,
1724+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
17221725
metadata: Sequence[Tuple[str, str]] = (),
17231726
) -> locations_pb2.Location:
17241727
r"""Gets information about a location.
@@ -1772,7 +1775,7 @@ def list_locations(
17721775
request: Optional[locations_pb2.ListLocationsRequest] = None,
17731776
*,
17741777
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1775-
timeout: Optional[float] = None,
1778+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
17761779
metadata: Sequence[Tuple[str, str]] = (),
17771780
) -> locations_pb2.ListLocationsResponse:
17781781
r"""Lists information about the supported locations for this service.
@@ -1822,14 +1825,9 @@ def list_locations(
18221825
return response
18231826

18241827

1825-
try:
1826-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1827-
gapic_version=pkg_resources.get_distribution(
1828-
"google-cloud-beyondcorp-clientconnectorservices",
1829-
).version,
1830-
)
1831-
except pkg_resources.DistributionNotFound:
1832-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
1828+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1829+
gapic_version=package_version.__version__
1830+
)
18331831

18341832

18351833
__all__ = ("ClientConnectorServicesServiceClient",)

packages/google-cloud-beyondcorp-clientconnectorservices/google/cloud/beyondcorp_clientconnectorservices_v1/services/client_connector_services_service/transports/base.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,17 @@
2727
from google.iam.v1 import policy_pb2 # type: ignore
2828
from google.longrunning import operations_pb2 # type: ignore
2929
from google.oauth2 import service_account # type: ignore
30-
import pkg_resources
3130

31+
from google.cloud.beyondcorp_clientconnectorservices_v1 import (
32+
gapic_version as package_version,
33+
)
3234
from google.cloud.beyondcorp_clientconnectorservices_v1.types import (
3335
client_connector_services_service,
3436
)
3537

36-
try:
37-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
38-
gapic_version=pkg_resources.get_distribution(
39-
"google-cloud-beyondcorp-clientconnectorservices",
40-
).version,
41-
)
42-
except pkg_resources.DistributionNotFound:
43-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
38+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
39+
gapic_version=package_version.__version__
40+
)
4441

4542

4643
class ClientConnectorServicesServiceTransport(abc.ABC):

packages/google-cloud-beyondcorp-clientconnectorservices/google/cloud/beyondcorp_clientconnectorservices_v1/services/client_connector_services_service/transports/rest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,7 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient:
615615
credentials=self._credentials,
616616
scopes=self._scopes,
617617
http_options=http_options,
618+
path_prefix="v1",
618619
)
619620

620621
self._operations_client = operations_v1.AbstractOperationsClient(

0 commit comments

Comments
 (0)