Skip to content

Commit b622ca0

Browse files
chore: use gapic-generator-python 0.56.2 (#240)
* 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 9d2dc18 commit b622ca0

File tree

29 files changed

+755
-96
lines changed

29 files changed

+755
-96
lines changed

packages/google-cloud-documentai/google/cloud/documentai_v1/services/document_processor_service/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.api_core import operation # type: ignore
3235
from google.api_core import operation_async # type: ignore

packages/google-cloud-documentai/google/cloud/documentai_v1/services/document_processor_service/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.api_core import operation # type: ignore
3638
from google.api_core import operation_async # type: ignore
@@ -308,8 +310,15 @@ def __init__(
308310
client_options = client_options_lib.ClientOptions()
309311

310312
# Create SSL credentials for mutual TLS if needed.
311-
use_client_cert = bool(
312-
util.strtobool(os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false"))
313+
if os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") not in (
314+
"true",
315+
"false",
316+
):
317+
raise ValueError(
318+
"Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`"
319+
)
320+
use_client_cert = (
321+
os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") == "true"
313322
)
314323

315324
client_cert_source_func = None

packages/google-cloud-documentai/google/cloud/documentai_v1/services/document_processor_service/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-documentai/google/cloud/documentai_v1/services/document_processor_service/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-documentai/google/cloud/documentai_v1/services/document_processor_service/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-documentai/google/cloud/documentai_v1/types/document.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,14 @@ class Document(proto.Message):
5151
not supported. See `Google Cloud Storage Request
5252
URIs <https://cloud.google.com/storage/docs/reference-uris>`__
5353
for more info.
54+
5455
This field is a member of `oneof`_ ``source``.
5556
content (bytes):
5657
Optional. Inline document content, represented as a stream
5758
of bytes. Note: As with all ``bytes`` fields, protobuffers
5859
use a pure binary representation, whereas JSON
5960
representations use base64.
61+
6062
This field is a member of `oneof`_ ``source``.
6163
mime_type (str):
6264
An IANA published MIME type (also referred to
@@ -703,24 +705,29 @@ class NormalizedValue(proto.Message):
703705
money_value (google.type.money_pb2.Money):
704706
Money value. See also:
705707
https://github.com/googleapis/googleapis/blob/master/google/type/money.proto
708+
706709
This field is a member of `oneof`_ ``structured_value``.
707710
date_value (google.type.date_pb2.Date):
708711
Date value. Includes year, month, day. See
709712
also:
710713
https://github.com/googleapis/googleapis/blob/master/google/type/date.proto
714+
711715
This field is a member of `oneof`_ ``structured_value``.
712716
datetime_value (google.type.datetime_pb2.DateTime):
713717
DateTime value. Includes date, time, and
714718
timezone. See also:
715719
https://github.com/googleapis/googleapis/blob/master/google/type/datetime.proto
720+
716721
This field is a member of `oneof`_ ``structured_value``.
717722
address_value (google.type.postal_address_pb2.PostalAddress):
718723
Postal address. See also:
719724
https://github.com/googleapis/googleapis/blob/master/google/type/postal_address.proto
725+
720726
This field is a member of `oneof`_ ``structured_value``.
721727
boolean_value (bool):
722728
Boolean value. Can be used for entities with
723729
binary values, or for checkboxes.
730+
724731
This field is a member of `oneof`_ ``structured_value``.
725732
text (str):
726733
Required. Normalized entity value stored as a string. This
@@ -979,10 +986,12 @@ class Revision(proto.Message):
979986
agent (str):
980987
If the change was made by a person specify
981988
the name or id of that person.
989+
982990
This field is a member of `oneof`_ ``source``.
983991
processor (str):
984992
If the annotation was made by processor
985993
identify the processor by its resource name.
994+
986995
This field is a member of `oneof`_ ``source``.
987996
id (str):
988997
Id of the revision. Unique within the

packages/google-cloud-documentai/google/cloud/documentai_v1/types/document_io.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,12 @@ class BatchDocumentsInputConfig(proto.Message):
9696
gcs_prefix (google.cloud.documentai_v1.types.GcsPrefix):
9797
The set of documents that match the specified Cloud Storage
9898
[gcs_prefix].
99+
99100
This field is a member of `oneof`_ ``source``.
100101
gcs_documents (google.cloud.documentai_v1.types.GcsDocuments):
101102
The set of documents individually specified
102103
on Cloud Storage.
104+
103105
This field is a member of `oneof`_ ``source``.
104106
"""
105107

@@ -122,6 +124,7 @@ class DocumentOutputConfig(proto.Message):
122124
gcs_output_config (google.cloud.documentai_v1.types.DocumentOutputConfig.GcsOutputConfig):
123125
Output config to write the results to Cloud
124126
Storage.
127+
125128
This field is a member of `oneof`_ ``destination``.
126129
"""
127130

packages/google-cloud-documentai/google/cloud/documentai_v1/types/document_processor_service.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,11 @@ class ProcessRequest(proto.Message):
5151
Attributes:
5252
inline_document (google.cloud.documentai_v1.types.Document):
5353
An inline document proto.
54+
5455
This field is a member of `oneof`_ ``source``.
5556
raw_document (google.cloud.documentai_v1.types.RawDocument):
5657
A raw document content (bytes).
58+
5759
This field is a member of `oneof`_ ``source``.
5860
name (str):
5961
Required. The processor resource name.
@@ -226,6 +228,7 @@ class ReviewDocumentRequest(proto.Message):
226228
Attributes:
227229
inline_document (google.cloud.documentai_v1.types.Document):
228230
An inline document proto.
231+
229232
This field is a member of `oneof`_ ``source``.
230233
human_review_config (str):
231234
Required. The resource name of the

packages/google-cloud-documentai/google/cloud/documentai_v1beta2/services/document_understanding_service/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.api_core import operation # type: ignore
3235
from google.api_core import operation_async # type: ignore

packages/google-cloud-documentai/google/cloud/documentai_v1beta2/services/document_understanding_service/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.api_core import operation # type: ignore
3638
from google.api_core import operation_async # type: ignore
@@ -279,8 +281,15 @@ def __init__(
279281
client_options = client_options_lib.ClientOptions()
280282

281283
# Create SSL credentials for mutual TLS if needed.
282-
use_client_cert = bool(
283-
util.strtobool(os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false"))
284+
if os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") not in (
285+
"true",
286+
"false",
287+
):
288+
raise ValueError(
289+
"Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`"
290+
)
291+
use_client_cert = (
292+
os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") == "true"
284293
)
285294

286295
client_cert_source_func = None

0 commit comments

Comments
 (0)