Skip to content

Commit 66543e1

Browse files
chore: use gapic-generator-python 0.56.2 (#68)
* chore: update Java and Python dependencies PiperOrigin-RevId: 408420890 Source-Link: googleapis/googleapis@2921f9f Source-Link: googleapis/googleapis-gen@6598ca8 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNjU5OGNhOGNiYmY1MjI2NzMzYTA5OWM0NTA2NTE4YTVhZjZmZjc0YyJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 6d1f71f commit 66543e1

File tree

12 files changed

+75
-44
lines changed

12 files changed

+75
-44
lines changed

packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/services/connection_service/async_client.py

+8-5
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,17 @@
1919
from typing import Dict, Sequence, Tuple, Type, Union
2020
import pkg_resources
2121

22-
from google.api_core.client_options import ClientOptions # type: ignore
23-
from google.api_core import exceptions as core_exceptions # type: ignore
24-
from google.api_core import gapic_v1 # type: ignore
25-
from google.api_core import retry as retries # type: ignore
22+
from google.api_core.client_options import ClientOptions
23+
from google.api_core import exceptions as core_exceptions
24+
from google.api_core import gapic_v1
25+
from google.api_core import retry as retries
2626
from google.auth import credentials as ga_credentials # type: ignore
2727
from google.oauth2 import service_account # type: ignore
2828

29-
OptionalRetry = Union[retries.Retry, object]
29+
try:
30+
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
31+
except AttributeError: # pragma: NO COVER
32+
OptionalRetry = Union[retries.Retry, object] # type: ignore
3033

3134
from google.cloud.apigeeconnect_v1.services.connection_service import pagers
3235
from google.cloud.apigeeconnect_v1.types import connection

packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/services/connection_service/client.py

+17-8
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,25 @@
1414
# limitations under the License.
1515
#
1616
from collections import OrderedDict
17-
from distutils import util
1817
import os
1918
import re
2019
from typing import Dict, Optional, Sequence, Tuple, Type, Union
2120
import pkg_resources
2221

23-
from google.api_core import client_options as client_options_lib # type: ignore
24-
from google.api_core import exceptions as core_exceptions # type: ignore
25-
from google.api_core import gapic_v1 # type: ignore
26-
from google.api_core import retry as retries # type: ignore
22+
from google.api_core import client_options as client_options_lib
23+
from google.api_core import exceptions as core_exceptions
24+
from google.api_core import gapic_v1
25+
from google.api_core import retry as retries
2726
from google.auth import credentials as ga_credentials # type: ignore
2827
from google.auth.transport import mtls # type: ignore
2928
from google.auth.transport.grpc import SslCredentials # type: ignore
3029
from google.auth.exceptions import MutualTLSChannelError # type: ignore
3130
from google.oauth2 import service_account # type: ignore
3231

33-
OptionalRetry = Union[retries.Retry, object]
32+
try:
33+
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
34+
except AttributeError: # pragma: NO COVER
35+
OptionalRetry = Union[retries.Retry, object] # type: ignore
3436

3537
from google.cloud.apigeeconnect_v1.services.connection_service import pagers
3638
from google.cloud.apigeeconnect_v1.types import connection
@@ -284,8 +286,15 @@ def __init__(
284286
client_options = client_options_lib.ClientOptions()
285287

286288
# Create SSL credentials for mutual TLS if needed.
287-
use_client_cert = bool(
288-
util.strtobool(os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false"))
289+
if os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") not in (
290+
"true",
291+
"false",
292+
):
293+
raise ValueError(
294+
"Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`"
295+
)
296+
use_client_cert = (
297+
os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") == "true"
289298
)
290299

291300
client_cert_source_func = None

packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/services/connection_service/transports/base.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
import pkg_resources
1919

2020
import google.auth # type: ignore
21-
import google.api_core # type: ignore
22-
from google.api_core import exceptions as core_exceptions # type: ignore
23-
from google.api_core import gapic_v1 # type: ignore
24-
from google.api_core import retry as retries # type: ignore
21+
import google.api_core
22+
from google.api_core import exceptions as core_exceptions
23+
from google.api_core import gapic_v1
24+
from google.api_core import retry as retries
2525
from google.auth import credentials as ga_credentials # type: ignore
2626
from google.oauth2 import service_account # type: ignore
2727

packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/services/connection_service/transports/grpc.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
import warnings
1717
from typing import Callable, Dict, Optional, Sequence, Tuple, Union
1818

19-
from google.api_core import grpc_helpers # type: ignore
20-
from google.api_core import gapic_v1 # type: ignore
19+
from google.api_core import grpc_helpers
20+
from google.api_core import gapic_v1
2121
import google.auth # type: ignore
2222
from google.auth import credentials as ga_credentials # type: ignore
2323
from google.auth.transport.grpc import SslCredentials # type: ignore

packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/services/connection_service/transports/grpc_asyncio.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
import warnings
1717
from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union
1818

19-
from google.api_core import gapic_v1 # type: ignore
20-
from google.api_core import grpc_helpers_async # type: ignore
19+
from google.api_core import gapic_v1
20+
from google.api_core import grpc_helpers_async
2121
from google.auth import credentials as ga_credentials # type: ignore
2222
from google.auth.transport.grpc import SslCredentials # type: ignore
2323

packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/services/tether/async_client.py

+8-5
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,17 @@
2828
)
2929
import pkg_resources
3030

31-
from google.api_core.client_options import ClientOptions # type: ignore
32-
from google.api_core import exceptions as core_exceptions # type: ignore
33-
from google.api_core import gapic_v1 # type: ignore
34-
from google.api_core import retry as retries # type: ignore
31+
from google.api_core.client_options import ClientOptions
32+
from google.api_core import exceptions as core_exceptions
33+
from google.api_core import gapic_v1
34+
from google.api_core import retry as retries
3535
from google.auth import credentials as ga_credentials # type: ignore
3636
from google.oauth2 import service_account # type: ignore
3737

38-
OptionalRetry = Union[retries.Retry, object]
38+
try:
39+
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
40+
except AttributeError: # pragma: NO COVER
41+
OptionalRetry = Union[retries.Retry, object] # type: ignore
3942

4043
from google.cloud.apigeeconnect_v1.types import tether
4144
from google.protobuf import duration_pb2 # type: ignore

packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/services/tether/client.py

+17-8
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,25 @@
1414
# limitations under the License.
1515
#
1616
from collections import OrderedDict
17-
from distutils import util
1817
import os
1918
import re
2019
from typing import Dict, Optional, Iterable, Iterator, Sequence, Tuple, Type, Union
2120
import pkg_resources
2221

23-
from google.api_core import client_options as client_options_lib # type: ignore
24-
from google.api_core import exceptions as core_exceptions # type: ignore
25-
from google.api_core import gapic_v1 # type: ignore
26-
from google.api_core import retry as retries # type: ignore
22+
from google.api_core import client_options as client_options_lib
23+
from google.api_core import exceptions as core_exceptions
24+
from google.api_core import gapic_v1
25+
from google.api_core import retry as retries
2726
from google.auth import credentials as ga_credentials # type: ignore
2827
from google.auth.transport import mtls # type: ignore
2928
from google.auth.transport.grpc import SslCredentials # type: ignore
3029
from google.auth.exceptions import MutualTLSChannelError # type: ignore
3130
from google.oauth2 import service_account # type: ignore
3231

33-
OptionalRetry = Union[retries.Retry, object]
32+
try:
33+
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
34+
except AttributeError: # pragma: NO COVER
35+
OptionalRetry = Union[retries.Retry, object] # type: ignore
3436

3537
from google.cloud.apigeeconnect_v1.types import tether
3638
from google.protobuf import duration_pb2 # type: ignore
@@ -269,8 +271,15 @@ def __init__(
269271
client_options = client_options_lib.ClientOptions()
270272

271273
# Create SSL credentials for mutual TLS if needed.
272-
use_client_cert = bool(
273-
util.strtobool(os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false"))
274+
if os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") not in (
275+
"true",
276+
"false",
277+
):
278+
raise ValueError(
279+
"Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`"
280+
)
281+
use_client_cert = (
282+
os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") == "true"
274283
)
275284

276285
client_cert_source_func = None

packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/services/tether/transports/base.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
import pkg_resources
1919

2020
import google.auth # type: ignore
21-
import google.api_core # type: ignore
22-
from google.api_core import exceptions as core_exceptions # type: ignore
23-
from google.api_core import gapic_v1 # type: ignore
24-
from google.api_core import retry as retries # type: ignore
21+
import google.api_core
22+
from google.api_core import exceptions as core_exceptions
23+
from google.api_core import gapic_v1
24+
from google.api_core import retry as retries
2525
from google.auth import credentials as ga_credentials # type: ignore
2626
from google.oauth2 import service_account # type: ignore
2727

packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/services/tether/transports/grpc.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
import warnings
1717
from typing import Callable, Dict, Optional, Sequence, Tuple, Union
1818

19-
from google.api_core import grpc_helpers # type: ignore
20-
from google.api_core import gapic_v1 # type: ignore
19+
from google.api_core import grpc_helpers
20+
from google.api_core import gapic_v1
2121
import google.auth # type: ignore
2222
from google.auth import credentials as ga_credentials # type: ignore
2323
from google.auth.transport.grpc import SslCredentials # type: ignore

packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/services/tether/transports/grpc_asyncio.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
import warnings
1717
from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union
1818

19-
from google.api_core import gapic_v1 # type: ignore
20-
from google.api_core import grpc_helpers_async # type: ignore
19+
from google.api_core import gapic_v1
20+
from google.api_core import grpc_helpers_async
2121
from google.auth import credentials as ga_credentials # type: ignore
2222
from google.auth.transport.grpc import SslCredentials # type: ignore
2323

packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/types/tether.py

+3
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,15 @@ class Payload(proto.Message):
9797
Attributes:
9898
http_request (google.cloud.apigeeconnect_v1.types.HttpRequest):
9999
The HttpRequest proto.
100+
100101
This field is a member of `oneof`_ ``kind``.
101102
stream_info (google.cloud.apigeeconnect_v1.types.StreamInfo):
102103
The information of stream.
104+
103105
This field is a member of `oneof`_ ``kind``.
104106
action (google.cloud.apigeeconnect_v1.types.Action):
105107
The action taken by agent.
108+
106109
This field is a member of `oneof`_ ``kind``.
107110
"""
108111

packages/google-cloud-apigee-connect/tests/unit/gapic/apigeeconnect_v1/test_connection_service.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,9 @@ def test_list_connections_flattened():
643643
# request object values.
644644
assert len(call.mock_calls) == 1
645645
_, args, _ = call.mock_calls[0]
646-
assert args[0].parent == "parent_value"
646+
arg = args[0].parent
647+
mock_val = "parent_value"
648+
assert arg == mock_val
647649

648650

649651
def test_list_connections_flattened_error():
@@ -679,7 +681,9 @@ async def test_list_connections_flattened_async():
679681
# request object values.
680682
assert len(call.mock_calls)
681683
_, args, _ = call.mock_calls[0]
682-
assert args[0].parent == "parent_value"
684+
arg = args[0].parent
685+
mock_val = "parent_value"
686+
assert arg == mock_val
683687

684688

685689
@pytest.mark.asyncio

0 commit comments

Comments
 (0)