Skip to content

Commit 71bed56

Browse files
fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#39)
* 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 <[email protected]>
1 parent d030d30 commit 71bed56

File tree

11 files changed

+64
-64
lines changed

11 files changed

+64
-64
lines changed

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

packages/google-cloud-beyondcorp-appgateways/google/cloud/beyondcorp_appgateways_v1/services/app_gateways_service/async_client.py

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
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_appgateways_v1 import gapic_version as package_version
3839

3940
try:
4041
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -247,7 +248,7 @@ async def list_app_gateways(
247248
*,
248249
parent: Optional[str] = None,
249250
retry: OptionalRetry = gapic_v1.method.DEFAULT,
250-
timeout: Optional[float] = None,
251+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
251252
metadata: Sequence[Tuple[str, str]] = (),
252253
) -> pagers.ListAppGatewaysAsyncPager:
253254
r"""Lists AppGateways in a given project and location.
@@ -365,7 +366,7 @@ async def get_app_gateway(
365366
*,
366367
name: Optional[str] = None,
367368
retry: OptionalRetry = gapic_v1.method.DEFAULT,
368-
timeout: Optional[float] = None,
369+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
369370
metadata: Sequence[Tuple[str, str]] = (),
370371
) -> app_gateways_service.AppGateway:
371372
r"""Gets details of a single AppGateway.
@@ -477,7 +478,7 @@ async def create_app_gateway(
477478
app_gateway: Optional[app_gateways_service.AppGateway] = None,
478479
app_gateway_id: Optional[str] = None,
479480
retry: OptionalRetry = gapic_v1.method.DEFAULT,
480-
timeout: Optional[float] = None,
481+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
481482
metadata: Sequence[Tuple[str, str]] = (),
482483
) -> operation_async.AsyncOperation:
483484
r"""Creates a new AppGateway in a given project and
@@ -514,7 +515,7 @@ async def sample_create_app_gateway():
514515
515516
print("Waiting for operation to complete...")
516517
517-
response = await operation.result()
518+
response = (await operation).result()
518519
519520
# Handle the response
520521
print(response)
@@ -628,7 +629,7 @@ async def delete_app_gateway(
628629
*,
629630
name: Optional[str] = None,
630631
retry: OptionalRetry = gapic_v1.method.DEFAULT,
631-
timeout: Optional[float] = None,
632+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
632633
metadata: Sequence[Tuple[str, str]] = (),
633634
) -> operation_async.AsyncOperation:
634635
r"""Deletes a single AppGateway.
@@ -658,7 +659,7 @@ async def sample_delete_app_gateway():
658659
659660
print("Waiting for operation to complete...")
660661
661-
response = await operation.result()
662+
response = (await operation).result()
662663
663664
# Handle the response
664665
print(response)
@@ -751,7 +752,7 @@ async def list_operations(
751752
request: Optional[operations_pb2.ListOperationsRequest] = None,
752753
*,
753754
retry: OptionalRetry = gapic_v1.method.DEFAULT,
754-
timeout: Optional[float] = None,
755+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
755756
metadata: Sequence[Tuple[str, str]] = (),
756757
) -> operations_pb2.ListOperationsResponse:
757758
r"""Lists operations that match the specified filter in the request.
@@ -805,7 +806,7 @@ async def get_operation(
805806
request: Optional[operations_pb2.GetOperationRequest] = None,
806807
*,
807808
retry: OptionalRetry = gapic_v1.method.DEFAULT,
808-
timeout: Optional[float] = None,
809+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
809810
metadata: Sequence[Tuple[str, str]] = (),
810811
) -> operations_pb2.Operation:
811812
r"""Gets the latest state of a long-running operation.
@@ -859,7 +860,7 @@ async def delete_operation(
859860
request: Optional[operations_pb2.DeleteOperationRequest] = None,
860861
*,
861862
retry: OptionalRetry = gapic_v1.method.DEFAULT,
862-
timeout: Optional[float] = None,
863+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
863864
metadata: Sequence[Tuple[str, str]] = (),
864865
) -> None:
865866
r"""Deletes a long-running operation.
@@ -914,7 +915,7 @@ async def cancel_operation(
914915
request: Optional[operations_pb2.CancelOperationRequest] = None,
915916
*,
916917
retry: OptionalRetry = gapic_v1.method.DEFAULT,
917-
timeout: Optional[float] = None,
918+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
918919
metadata: Sequence[Tuple[str, str]] = (),
919920
) -> None:
920921
r"""Starts asynchronous cancellation on a long-running operation.
@@ -968,7 +969,7 @@ async def set_iam_policy(
968969
request: Optional[iam_policy_pb2.SetIamPolicyRequest] = None,
969970
*,
970971
retry: OptionalRetry = gapic_v1.method.DEFAULT,
971-
timeout: Optional[float] = None,
972+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
972973
metadata: Sequence[Tuple[str, str]] = (),
973974
) -> policy_pb2.Policy:
974975
r"""Sets the IAM access control policy on the specified function.
@@ -1088,7 +1089,7 @@ async def get_iam_policy(
10881089
request: Optional[iam_policy_pb2.GetIamPolicyRequest] = None,
10891090
*,
10901091
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1091-
timeout: Optional[float] = None,
1092+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
10921093
metadata: Sequence[Tuple[str, str]] = (),
10931094
) -> policy_pb2.Policy:
10941095
r"""Gets the IAM access control policy for a function.
@@ -1209,7 +1210,7 @@ async def test_iam_permissions(
12091210
request: Optional[iam_policy_pb2.TestIamPermissionsRequest] = None,
12101211
*,
12111212
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1212-
timeout: Optional[float] = None,
1213+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
12131214
metadata: Sequence[Tuple[str, str]] = (),
12141215
) -> iam_policy_pb2.TestIamPermissionsResponse:
12151216
r"""Tests the specified IAM permissions against the IAM access control
@@ -1268,7 +1269,7 @@ async def get_location(
12681269
request: Optional[locations_pb2.GetLocationRequest] = None,
12691270
*,
12701271
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1271-
timeout: Optional[float] = None,
1272+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
12721273
metadata: Sequence[Tuple[str, str]] = (),
12731274
) -> locations_pb2.Location:
12741275
r"""Gets information about a location.
@@ -1322,7 +1323,7 @@ async def list_locations(
13221323
request: Optional[locations_pb2.ListLocationsRequest] = None,
13231324
*,
13241325
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1325-
timeout: Optional[float] = None,
1326+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
13261327
metadata: Sequence[Tuple[str, str]] = (),
13271328
) -> locations_pb2.ListLocationsResponse:
13281329
r"""Lists information about the supported locations for this service.
@@ -1378,14 +1379,9 @@ async def __aexit__(self, exc_type, exc, tb):
13781379
await self.transport.close()
13791380

13801381

1381-
try:
1382-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1383-
gapic_version=pkg_resources.get_distribution(
1384-
"google-cloud-beyondcorp-appgateways",
1385-
).version,
1386-
)
1387-
except pkg_resources.DistributionNotFound:
1388-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
1382+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1383+
gapic_version=package_version.__version__
1384+
)
13891385

13901386

13911387
__all__ = ("AppGatewaysServiceAsyncClient",)

packages/google-cloud-beyondcorp-appgateways/google/cloud/beyondcorp_appgateways_v1/services/app_gateways_service/client.py

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
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_appgateways_v1 import gapic_version as package_version
4243

4344
try:
4445
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -475,7 +476,7 @@ def list_app_gateways(
475476
*,
476477
parent: Optional[str] = None,
477478
retry: OptionalRetry = gapic_v1.method.DEFAULT,
478-
timeout: Optional[float] = None,
479+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
479480
metadata: Sequence[Tuple[str, str]] = (),
480481
) -> pagers.ListAppGatewaysPager:
481482
r"""Lists AppGateways in a given project and location.
@@ -593,7 +594,7 @@ def get_app_gateway(
593594
*,
594595
name: Optional[str] = None,
595596
retry: OptionalRetry = gapic_v1.method.DEFAULT,
596-
timeout: Optional[float] = None,
597+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
597598
metadata: Sequence[Tuple[str, str]] = (),
598599
) -> app_gateways_service.AppGateway:
599600
r"""Gets details of a single AppGateway.
@@ -705,7 +706,7 @@ def create_app_gateway(
705706
app_gateway: Optional[app_gateways_service.AppGateway] = None,
706707
app_gateway_id: Optional[str] = None,
707708
retry: OptionalRetry = gapic_v1.method.DEFAULT,
708-
timeout: Optional[float] = None,
709+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
709710
metadata: Sequence[Tuple[str, str]] = (),
710711
) -> operation.Operation:
711712
r"""Creates a new AppGateway in a given project and
@@ -856,7 +857,7 @@ def delete_app_gateway(
856857
*,
857858
name: Optional[str] = None,
858859
retry: OptionalRetry = gapic_v1.method.DEFAULT,
859-
timeout: Optional[float] = None,
860+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
860861
metadata: Sequence[Tuple[str, str]] = (),
861862
) -> operation.Operation:
862863
r"""Deletes a single AppGateway.
@@ -992,7 +993,7 @@ def list_operations(
992993
request: Optional[operations_pb2.ListOperationsRequest] = None,
993994
*,
994995
retry: OptionalRetry = gapic_v1.method.DEFAULT,
995-
timeout: Optional[float] = None,
996+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
996997
metadata: Sequence[Tuple[str, str]] = (),
997998
) -> operations_pb2.ListOperationsResponse:
998999
r"""Lists operations that match the specified filter in the request.
@@ -1046,7 +1047,7 @@ def get_operation(
10461047
request: Optional[operations_pb2.GetOperationRequest] = None,
10471048
*,
10481049
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1049-
timeout: Optional[float] = None,
1050+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
10501051
metadata: Sequence[Tuple[str, str]] = (),
10511052
) -> operations_pb2.Operation:
10521053
r"""Gets the latest state of a long-running operation.
@@ -1100,7 +1101,7 @@ def delete_operation(
11001101
request: Optional[operations_pb2.DeleteOperationRequest] = None,
11011102
*,
11021103
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1103-
timeout: Optional[float] = None,
1104+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
11041105
metadata: Sequence[Tuple[str, str]] = (),
11051106
) -> None:
11061107
r"""Deletes a long-running operation.
@@ -1155,7 +1156,7 @@ def cancel_operation(
11551156
request: Optional[operations_pb2.CancelOperationRequest] = None,
11561157
*,
11571158
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1158-
timeout: Optional[float] = None,
1159+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
11591160
metadata: Sequence[Tuple[str, str]] = (),
11601161
) -> None:
11611162
r"""Starts asynchronous cancellation on a long-running operation.
@@ -1209,7 +1210,7 @@ def set_iam_policy(
12091210
request: Optional[iam_policy_pb2.SetIamPolicyRequest] = None,
12101211
*,
12111212
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1212-
timeout: Optional[float] = None,
1213+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
12131214
metadata: Sequence[Tuple[str, str]] = (),
12141215
) -> policy_pb2.Policy:
12151216
r"""Sets the IAM access control policy on the specified function.
@@ -1329,7 +1330,7 @@ def get_iam_policy(
13291330
request: Optional[iam_policy_pb2.GetIamPolicyRequest] = None,
13301331
*,
13311332
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1332-
timeout: Optional[float] = None,
1333+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
13331334
metadata: Sequence[Tuple[str, str]] = (),
13341335
) -> policy_pb2.Policy:
13351336
r"""Gets the IAM access control policy for a function.
@@ -1450,7 +1451,7 @@ def test_iam_permissions(
14501451
request: Optional[iam_policy_pb2.TestIamPermissionsRequest] = None,
14511452
*,
14521453
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1453-
timeout: Optional[float] = None,
1454+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
14541455
metadata: Sequence[Tuple[str, str]] = (),
14551456
) -> iam_policy_pb2.TestIamPermissionsResponse:
14561457
r"""Tests the specified IAM permissions against the IAM access control
@@ -1509,7 +1510,7 @@ def get_location(
15091510
request: Optional[locations_pb2.GetLocationRequest] = None,
15101511
*,
15111512
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1512-
timeout: Optional[float] = None,
1513+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
15131514
metadata: Sequence[Tuple[str, str]] = (),
15141515
) -> locations_pb2.Location:
15151516
r"""Gets information about a location.
@@ -1563,7 +1564,7 @@ def list_locations(
15631564
request: Optional[locations_pb2.ListLocationsRequest] = None,
15641565
*,
15651566
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1566-
timeout: Optional[float] = None,
1567+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
15671568
metadata: Sequence[Tuple[str, str]] = (),
15681569
) -> locations_pb2.ListLocationsResponse:
15691570
r"""Lists information about the supported locations for this service.
@@ -1613,14 +1614,9 @@ def list_locations(
16131614
return response
16141615

16151616

1616-
try:
1617-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1618-
gapic_version=pkg_resources.get_distribution(
1619-
"google-cloud-beyondcorp-appgateways",
1620-
).version,
1621-
)
1622-
except pkg_resources.DistributionNotFound:
1623-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
1617+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1618+
gapic_version=package_version.__version__
1619+
)
16241620

16251621

16261622
__all__ = ("AppGatewaysServiceClient",)

packages/google-cloud-beyondcorp-appgateways/google/cloud/beyondcorp_appgateways_v1/services/app_gateways_service/transports/base.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,13 @@
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_appgateways_v1 import gapic_version as package_version
3232
from google.cloud.beyondcorp_appgateways_v1.types import app_gateways_service
3333

34-
try:
35-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
36-
gapic_version=pkg_resources.get_distribution(
37-
"google-cloud-beyondcorp-appgateways",
38-
).version,
39-
)
40-
except pkg_resources.DistributionNotFound:
41-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
34+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
35+
gapic_version=package_version.__version__
36+
)
4237

4338

4439
class AppGatewaysServiceTransport(abc.ABC):

packages/google-cloud-beyondcorp-appgateways/google/cloud/beyondcorp_appgateways_v1/services/app_gateways_service/transports/rest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,7 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient:
566566
credentials=self._credentials,
567567
scopes=self._scopes,
568568
http_options=http_options,
569+
path_prefix="v1",
569570
)
570571

571572
self._operations_client = operations_v1.AbstractOperationsClient(

packages/google-cloud-beyondcorp-appgateways/release-please-config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"release-type": "python",
66
"extra-files": [
77
"google/cloud/beyondcorp_appgateways/gapic_version.py",
8+
"google/cloud/beyondcorp_appgateways_v1/gapic_version.py",
89
{
910
"type": "json",
1011
"path": "samples/generated_samples/snippet_metadata_google.cloud.beyondcorp.appgateways.v1.json",

packages/google-cloud-beyondcorp-appgateways/samples/generated_samples/beyondcorp_v1_generated_app_gateways_service_create_app_gateway_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ async def sample_create_app_gateway():
5454

5555
print("Waiting for operation to complete...")
5656

57-
response = await operation.result()
57+
response = (await operation).result()
5858

5959
# Handle the response
6060
print(response)

packages/google-cloud-beyondcorp-appgateways/samples/generated_samples/beyondcorp_v1_generated_app_gateways_service_delete_app_gateway_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ async def sample_delete_app_gateway():
4848

4949
print("Waiting for operation to complete...")
5050

51-
response = await operation.result()
51+
response = (await operation).result()
5252

5353
# Handle the response
5454
print(response)

packages/google-cloud-beyondcorp-appgateways/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
release_status = "Development Status :: 5 - Production/Stable"
3939

4040
dependencies = [
41-
"google-api-core[grpc] >= 1.33.2, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*",
41+
"google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*",
4242
"proto-plus >= 1.22.0, <2.0.0dev",
4343
"protobuf>=3.19.5,<5.0.0dev,!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5",
4444
"grpc-google-iam-v1 >= 0.12.4, < 1.0.0dev",

0 commit comments

Comments
 (0)