8000 chore: use gapic-generator-python 0.56.2 (#283) · googleapis/google-cloud-python@3063a32 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3063a32

Browse files
chore: use gapic-generator-python 0.56.2 (#283)
* 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 4a59b9a commit 3063a32

File tree

20 files changed

+259
-117
lines changed

20 files changed

+259
-117
lines changed

packages/google-cloud-python-speech/google/cloud/speech_v1/services/speech/async_client.py

Lines changed: 8 additions & 5 deletions
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.api_core import operation # type: ignore
4144
from google.api_core import operation_async # type: ignore

packages/google-cloud-python-speech/google/cloud/speech_v1/services/speech/client.py

Lines changed: 17 additions & 8 deletions
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.api_core import operation # type: ignore
3638
from google.api_core import operation_async # type: ignore
@@ -268,8 +270,15 @@ def __init__(
268270
client_options = client_options_lib.ClientOptions()
269271

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

275284
client_cert_source_func = None

packages/google-cloud-python-speech/google/cloud/speech_v1/services/speech/transports/base.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
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
25-
from google.api_core import operations_v1 # 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
25+
from google.api_core import operations_v1
2626
from google.auth import credentials as ga_credentials # type: ignore
2727
from google.oauth2 import service_account # type: ignore
2828

packages/google-cloud-python-speech/google/cloud/speech_v1/services/speech/transports/grpc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
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 operations_v1 # type: ignore
21-
from google.api_core import gapic_v1 # type: ignore
19+
from google.api_core import grpc_helpers
20+
from google.api_core import operations_v1
21+
from google.api_core import gapic_v1
2222
import google.auth # type: ignore
2323
from google.auth import credentials as ga_credentials # type: ignore
2424
from google.auth.transport.grpc import SslCredentials # type: ignore

packages/google-cloud-python-speech/google/cloud/speech_v1/services/speech/transports/grpc_asyncio.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
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
21-
from google.api_core import operations_v1 # type: ignore
19+
from google.api_core import gapic_v1
20+
from google.api_core import grpc_helpers_async
21+
from google.api_core import operations_v1
2222
from google.auth import credentials as ga_credentials # type: ignore
2323
from google.auth.transport.grpc import SslCredentials # type: ignore
2424

packages/google-cloud-python-speech/google/cloud/speech_v1/types/cloud_speech.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ class TranscriptOutputConfig(proto.Message):
9898
Must be specified in the format:
9999
``gs://bucket_name/object_name``, and the bucket must
100100
already exist.
101+
101102
This field is a member of `oneof`_ ``output_type``.
102103
"""
103104

@@ -125,6 +126,7 @@ class StreamingRecognizeRequest(proto.Message):
125126
Provides information to the recognizer that specifies how to
126127
process the request. The first ``StreamingRecognizeRequest``
127128
message must contain a ``streaming_config`` message.
129+
128130
This field is a member of `oneof`_ ``streaming_request``.
129131
audio_content (bytes):
130132
The audio data to be recognized. Sequential chunks of audio
@@ -137,6 +139,7 @@ class StreamingRecognizeRequest(proto.Message):
137139
fields, proto buffers use a pure binary representation (not
138140
base64). See `content
139141
limits <https://cloud.google.com/speech-to-text/quotas#content>`__.
142+
140143
This field is a member of `oneof`_ ``streaming_request``.
141144
"""
142145

@@ -557,6 +560,7 @@ class RecognitionAudio(proto.Message):
557560
``RecognitionConfig``. Note: as with all bytes fields, proto
558561
buffers use a pure binary representation, whereas JSON
559562
representations use base64.
563+
560564
This field is a member of `oneof`_ ``audio_source``.
561565
uri (str):
562566
URI that points to a file that contains audio data bytes as
@@ -568,6 +572,7 @@ class RecognitionAudio(proto.Message):
568572
[google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]).
569573
For more information, see `Request
570574
URIs <https://cloud.google.com/storage/docs/reference-uris>`__.
575+
571576
This field is a member of `oneof`_ ``audio_source``.
572577
"""
573578

packages/google-cloud-python-speech/google/cloud/speech_v1p1beta1/services/adaptation/async_client.py

Lines changed: 8 additions & 5 deletions
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.speech_v1p1beta1.services.adaptation import pagers
3235
from google.cloud.speech_v1p1beta1.types import cloud_speech_adaptation

packages/google-cloud-python-speech/google/cloud/speech_v1p1beta1/services/adaptation/client.py

Lines changed: 17 additions & 8 deletions
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.speech_v1p1beta1.services.adaptation import pagers
3638
from google.cloud.speech_v1p1beta1.types import cloud_speech_adaptation
@@ -299,8 +301,15 @@ def __init__(
299301
client_options = client_options_lib.ClientOptions()
300302

301303
# Create SSL credentials for mutual TLS if needed.
302-
use_client_cert = bool(
303-
util.strtobool(os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false"))
304+
if os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") not in (
305+
"true",
306+
"false",
307+
):
308+
raise ValueError(
309+
"Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`"
310+
)
311+
use_client_cert = (
312+
os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") == "true"
304313
)
305314

306315
client_cert_source_func = None

packages/google-cloud-python-speech/google/cloud/speech_v1p1beta1/services/adaptation/transports/base.py

Lines changed: 4 additions & 4 deletions
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-python-speech/google/cloud/speech_v1p1beta1/services/adaptation/transports/grpc.py

Lines changed: 2 additions & 2 deletions
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

0 commit comments

Comments
 (0)
0