Skip to content

Commit 9ab77d4

Browse files
chore: use gapic-generator-python 0.62.1 (#333)
- [ ] Regenerate this pull request now. fix: resolve DuplicateCredentialArgs error when using credentials_file committer: parthea PiperOrigin-RevId: 425964861 Source-Link: googleapis/googleapis@84b1a5a Source-Link: googleapis/googleapis-gen@4fb761b Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNGZiNzYxYmJkODUwNmFjMTU2ZjQ5YmFjNWYxODMwNmFhOGViM2FhOCJ9
1 parent 8b1d813 commit 9ab77d4

File tree

12 files changed

+236
-68
lines changed

12 files changed

+236
-68
lines changed

packages/google-cloud-translate/google/cloud/translate_v3/services/translation_service/async_client.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ async def translate_text(
321321
322322
"""
323323
# Create or coerce a protobuf request object.
324-
# Sanity check: If we got a request object, we should *not* have
324+
# Quick check: If we got a request object, we should *not* have
325325
# gotten any keyword arguments that map to the request.
326326
has_flattened_params = any(
327327
[
@@ -457,7 +457,7 @@ async def detect_language(
457457
458458
"""
459459
# Create or coerce a protobuf request object.
460-
# Sanity check: If we got a request object, we should *not* have
460+
# Quick check: If we got a request object, we should *not* have
461461
# gotten any keyword arguments that map to the request.
462462
has_flattened_params = any([parent, model, mime_type, content])
463463
if request is not None and has_flattened_params:
@@ -578,7 +578,7 @@ async def get_supported_languages(
578578
579579
"""
580580
# Create or coerce a protobuf request object.
581-
# Sanity check: If we got a request object, we should *not* have
581+
# Quick check: If we got a request object, we should *not* have
582582
# gotten any keyword arguments that map to the request.
583583
has_flattened_params = any([parent, model, display_language_code])
584584
if request is not None and has_flattened_params:
@@ -844,7 +844,7 @@ async def batch_translate_document(
844844
845845
"""
846846
# Create or coerce a protobuf request object.
847-
# Sanity check: If we got a request object, we should *not* have
847+
# Quick check: If we got a request object, we should *not* have
848848
# gotten any keyword arguments that map to the request.
849849
has_flattened_params = any(
850850
[
@@ -946,7 +946,7 @@ async def create_glossary(
946946
947947
"""
948948
# Create or coerce a protobuf request object.
949-
# Sanity check: If we got a request object, we should *not* have
949+
# Quick check: If we got a request object, we should *not* have
950950
# gotten any keyword arguments that map to the request.
951951
has_flattened_params = any([parent, glossary])
952952
if request is not None and has_flattened_params:
@@ -1030,7 +1030,7 @@ async def list_glossaries(
10301030
10311031
"""
10321032
# Create or coerce a protobuf request object.
1033-
# Sanity check: If we got a request object, we should *not* have
1033+
# Quick check: If we got a request object, we should *not* have
10341034
# gotten any keyword arguments that map to the request.
10351035
has_flattened_params = any([parent])
10361036
if request is not None and has_flattened_params:
@@ -1117,7 +1117,7 @@ async def get_glossary(
11171117
11181118
"""
11191119
# Create or coerce a protobuf request object.
1120-
# Sanity check: If we got a request object, we should *not* have
1120+
# Quick check: If we got a request object, we should *not* have
11211121
# gotten any keyword arguments that map to the request.
11221122
has_flattened_params = any([name])
11231123
if request is not None and has_flattened_params:
@@ -1202,7 +1202,7 @@ async def delete_glossary(
12021202
12031203
"""
12041204
# Create or coerce a protobuf request object.
1205-
# Sanity check: If we got a request object, we should *not* have
1205+
# Quick check: If we got a request object, we should *not* have
12061206
# gotten any keyword arguments that map to the request.
12071207
has_flattened_params = any([name])
12081208
if request is not None and has_flattened_params:

packages/google-cloud-translate/google/cloud/translate_v3/services/translation_service/client.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ def translate_text(
519519
520520
"""
521521
# Create or coerce a protobuf request object.
522-
# Sanity check: If we got a request object, we should *not* have
522+
# Quick check: If we got a request object, we should *not* have
523523
# gotten any keyword arguments that map to the request.
524524
has_flattened_params = any(
525525
[
@@ -655,7 +655,7 @@ def detect_language(
655655
656656
"""
657657
# Create or coerce a protobuf request object.
658-
# Sanity check: If we got a request object, we should *not* have
658+
# Quick check: If we got a request object, we should *not* have
659659
# gotten any keyword arguments that map to the request.
660660
has_flattened_params = any([parent, model, mime_type, content])
661661
if request is not None and has_flattened_params:
@@ -776,7 +776,7 @@ def get_supported_languages(
776776
777777
"""
778778
# Create or coerce a protobuf request object.
779-
# Sanity check: If we got a request object, we should *not* have
779+
# Quick check: If we got a request object, we should *not* have
780780
# gotten any keyword arguments that map to the request.
781781
has_flattened_params = any([parent, model, display_language_code])
782782
if request is not None and has_flattened_params:
@@ -1034,7 +1034,7 @@ def batch_translate_document(
10341034
10351035
"""
10361036
# Create or coerce a protobuf request object.
1037-
# Sanity check: If we got a request object, we should *not* have
1037+
# Quick check: If we got a request object, we should *not* have
10381038
# gotten any keyword arguments that map to the request.
10391039
has_flattened_params = any(
10401040
[
@@ -1136,7 +1136,7 @@ def create_glossary(
11361136
11371137
"""
11381138
# Create or coerce a protobuf request object.
1139-
# Sanity check: If we got a request object, we should *not* have
1139+
# Quick check: If we got a request object, we should *not* have
11401140
# gotten any keyword arguments that map to the request.
11411141
has_flattened_params = any([parent, glossary])
11421142
if request is not None and has_flattened_params:
@@ -1220,7 +1220,7 @@ def list_glossaries(
12201220
12211221
"""
12221222
# Create or coerce a protobuf request object.
1223-
# Sanity check: If we got a request object, we should *not* have
1223+
# Quick check: If we got a request object, we should *not* have
12241224
# gotten any keyword arguments that map to the request.
12251225
has_flattened_params = any([parent])
12261226
if request is not None and has_flattened_params:
@@ -1297,7 +1297,7 @@ def get_glossary(
12971297
12981298
"""
12991299
# Create or coerce a protobuf request object.
1300-
# Sanity check: If we got a request object, we should *not* have
1300+
# Quick check: If we got a request object, we should *not* have
13011301
# gotten any keyword arguments that map to the request.
13021302
has_flattened_params = any([name])
13031303
if request is not None and has_flattened_params:
@@ -1372,7 +1372,7 @@ def delete_glossary(
13721372
13731373
"""
13741374
# Create or coerce a protobuf request object.
1375-
# Sanity check: If we got a request object, we should *not* have
1375+
# Quick check: If we got a request object, we should *not* have
13761376
# gotten any keyword arguments that map to the request.
13771377
has_flattened_params = any([name])
13781378
if request is not None and has_flattened_params:

packages/google-cloud-translate/google/cloud/translate_v3/services/translation_service/transports/grpc.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,11 @@ def __init__(
161161
if not self._grpc_channel:
162162
self._grpc_channel = type(self).create_channel(
163163
self._host,
164+
# use the credentials which are saved
164165
credentials=self._credentials,
165-
credentials_file=credentials_file,
166+
# Set ``credentials_file`` to ``None`` here as
167+
# the credentials that we saved earlier should be used.
168+
credentials_file=None,
166169
scopes=self._scopes,
167170
ssl_credentials=self._ssl_channel_credentials,
168171
quota_project_id=quota_project_id,
@@ -235,7 +238,7 @@ def operations_client(self) -> operations_v1.OperationsClient:
235238
This property caches on the instance; repeated calls return the same
236239
client.
237240
"""
238-
# Sanity check: Only create a new client if we do not already have one.
241+
# Quick check: Only create a new client if we do not already have one.
239242
if self._operations_client is None:
240243
self._operations_client = operations_v1.OperationsClient(self.grpc_channel)
241244

packages/google-cloud-translate/google/cloud/translate_v3/services/translation_service/transports/grpc_asyncio.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,11 @@ def __init__(
206206
if not self._grpc_channel:
207207
self._grpc_channel = type(self).create_channel(
208208
self._host,
209+
# use the credentials which are saved
209210
credentials=self._credentials,
210-
credentials_file=credentials_file,
211+
# Set ``credentials_file`` to ``None`` here as
212+
# the credentials that we saved earlier should be used.
213+
credentials_file=None,
211214
scopes=self._scopes,
212215
ssl_credentials=self._ssl_channel_credentials,
213216
quota_project_id=quota_project_id,
@@ -237,7 +240,7 @@ def operations_client(self) -> operations_v1.OperationsAsyncClient:
237240
This property caches on the instance; repeated calls return the same
238241
client.
239242
"""
240-
# Sanity check: Only create a new client if we do not already have one.
243+
# Quick check: Only create a new client if we do not already have one.
241244
if self._operations_client is None:
242245
self._operations_client = operations_v1.OperationsAsyncClient(
243246
self.grpc_channel

packages/google-cloud-translate/google/cloud/translate_v3/types/translation_service.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ class TranslateTextGlossaryConfig(proto.Message):
7676
- User provided custom glossary:
7777
``projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}``
7878
ignore_case (bool):
79-
Optional. Indicates match is case-
80-
nsensitive. Default value is false if missing.
79+
Optional. Indicates match is
80+
case-insensitive. Default value is false if
81+
missing.
8182
"""
8283

8384
glossary = proto.Field(proto.STRING, number=1,)

packages/google-cloud-translate/google/cloud/translate_v3beta1/services/translation_service/async_client.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ async def detect_language(
326326
327327
"""
328328
# Create or coerce a protobuf request object.
329-
# Sanity check: If we got a request object, we should *not* have
329+
# Quick check: If we got a request object, we should *not* have
330330
# gotten any keyword arguments that map to the request.
331331
has_flattened_params = any([parent, model, mime_type])
332332
if request is not None and has_flattened_params:
@@ -445,7 +445,7 @@ async def get_supported_languages(
445445
446446
"""
447447
# Create or coerce a protobuf request object.
448-
# Sanity check: If we got a request object, we should *not* have
448+
# Quick check: If we got a request object, we should *not* have
449449
# gotten any keyword arguments that map to the request.
450450
has_flattened_params = any([parent, display_language_code, model])
451451
if request is not None and has_flattened_params:
@@ -625,11 +625,11 @@ async def batch_translate_document(
625625
metadata: Sequence[Tuple[str, str]] = (),
626626
) -> operation_async.AsyncOperation:
627627
r"""Translates a large volume of documents in
628-
asynchronous batch mode. This function provides real-
629-
time output as the inputs are being processed. If caller
630-
cancels a request, the partial results (for an input
631-
file, it's all or nothing) may still be available on the
632-
specified output location.
628+
asynchronous batch mode. This function provides
629+
real-time output as the inputs are being processed. If
630+
caller cancels a request, the partial results (for an
631+
input file, it's all or nothing) may still be available
632+
on the specified output location.
633633
This call returns immediately and you can use
634634
google.longrunning.Operation.name to poll the status of
635635
the call.
@@ -711,7 +711,7 @@ async def batch_translate_document(
711711
712712
"""
713713
# Create or coerce a protobuf request object.
714-
# Sanity check: If we got a request object, we should *not* have
714+
# Quick check: If we got a request object, we should *not* have
715715
# gotten any keyword arguments that map to the request.
716716
has_flattened_params = any(
717717
[
@@ -813,7 +813,7 @@ async def create_glossary(
813813
814814
"""
815815
# Create or coerce a protobuf request object.
816-
# Sanity check: If we got a request object, we should *not* have
816+
# Quick check: If we got a request object, we should *not* have
817817
# gotten any keyword arguments that map to the request.
818818
has_flattened_params = any([parent, glossary])
819819
if request is not None and has_flattened_params:
@@ -932,7 +932,7 @@ async def list_glossaries(
932932
933933
"""
934934
# Create or coerce a protobuf request object.
935-
# Sanity check: If we got a request object, we should *not* have
935+
# Quick check: If we got a request object, we should *not* have
936936
# gotten any keyword arguments that map to the request.
937937
has_flattened_params = any([parent, filter])
938938
if request is not None and has_flattened_params:
@@ -1021,7 +1021,7 @@ async def get_glossary(
10211021
10221022
"""
10231023
# Create or coerce a protobuf request object.
1024-
# Sanity check: If we got a request object, we should *not* have
1024+
# Quick check: If we got a request object, we should *not* have
10251025
# gotten any keyword arguments that map to the request.
10261026
has_flattened_params = any([name])
10271027
if request is not None and has_flattened_params:
@@ -1106,7 +1106,7 @@ async def delete_glossary(
11061106
11071107
"""
11081108
# Create or coerce a protobuf request object.
1109-
# Sanity check: If we got a request object, we should *not* have
1109+
# Quick check: If we got a request object, we should *not* have
11101110
# gotten any keyword arguments that map to the request.
11111111
has_flattened_params = any([name])
11121112
if request is not None and has_flattened_params:

packages/google-cloud-translate/google/cloud/translate_v3beta1/services/translation_service/client.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ def detect_language(
525525
526526
"""
527527
# Create or coerce a protobuf request object.
528-
# Sanity check: If we got a request object, we should *not* have
528+
# Quick check: If we got a request object, we should *not* have
529529
# gotten any keyword arguments that map to the request.
530530
has_flattened_params = any([parent, model, mime_type])
531531
if request is not None and has_flattened_params:
@@ -644,7 +644,7 @@ def get_supported_languages(
644644
645645
"""
646646
# Create or coerce a protobuf request object.
647-
# Sanity check: If we got a request object, we should *not* have
647+
# Quick check: If we got a request object, we should *not* have
648648
# gotten any keyword arguments that map to the request.
649649
has_flattened_params = any([parent, display_language_code, model])
650650
if request is not None and has_flattened_params:
@@ -816,11 +816,11 @@ def batch_translate_document(
816816
metadata: Sequence[Tuple[str, str]] = (),
817817
) -> operation.Operation:
818818
r"""Translates a large volume of documents in
819-
asynchronous batch mode. This function provides real-
820-
time output as the inputs are being processed. If caller
821-
cancels a request, the partial results (for an input
822-
file, it's all or nothing) may still be available on the
823-
specified output location.
819+
asynchronous batch mode. This function provides
820+
real-time output as the inputs are being processed. If
821+
caller cancels a request, the partial results (for an
822+
input file, it's all or nothing) may still be available
823+
on the specified output location.
824824
This call returns immediately and you can use
825825
google.longrunning.Operation.name to poll the status of
826826
the call.
@@ -902,7 +902,7 @@ def batch_translate_document(
902902
903903
"""
904904
# Create or coerce a protobuf request object.
905-
# Sanity check: If we got a request object, we should *not* have
905+
# Quick check: If we got a request object, we should *not* have
906906
# gotten any keyword arguments that map to the request.
907907
has_flattened_params = any(
908908
[
@@ -1004,7 +1004,7 @@ def create_glossary(
10041004
10051005
"""
10061006
# Create or coerce a protobuf request object.
1007-
# Sanity check: If we got a request object, we should *not* have
1007+
# Quick check: If we got a request object, we should *not* have
10081008
# gotten any keyword arguments that map to the request.
10091009
has_flattened_params = any([parent, glossary])
10101010
if request is not None and has_flattened_params:
@@ -1123,7 +1123,7 @@ def list_glossaries(
11231123
11241124
"""
11251125
# Create or coerce a protobuf request object.
1126-
# Sanity check: If we got a request object, we should *not* have
1126+
# Quick check: If we got a request object, we should *not* have
11271127
# gotten any keyword arguments that map to the request.
11281128
has_flattened_params = any([parent, filter])
11291129
if request is not None and has_flattened_params:
@@ -1202,7 +1202,7 @@ def get_glossary(
12021202
12031203
"""
12041204
# Create or coerce a protobuf request object.
1205-
# Sanity check: If we got a request object, we should *not* have
1205+
# Quick check: If we got a request object, we should *not* have
12061206
# gotten any keyword arguments that map to the request.
12071207
has_flattened_params = any([name])
12081208
if request is not None and has_flattened_params:
@@ -1277,7 +1277,7 @@ def delete_glossary(
12771277
12781278
"""
12791279
# Create or coerce a protobuf request object.
1280-
# Sanity check: If we got a request object, we should *not* have
1280+
# Quick check: If we got a request object, we should *not* have
12811281
# gotten any keyword arguments that map to the request.
12821282
has_flattened_params = any([name])
12831283
if request is not None and has_flattened_params:

packages/google-cloud-translate/google/cloud/translate_v3beta1/services/translation_service/transports/grpc.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,11 @@ def __init__(
161161
if not self._grpc_channel:
162162
self._grpc_channel = type(self).create_channel(
163163
self._host,
164+
# use the credentials which are saved
164165
credentials=self._credentials,
165-
credentials_file=credentials_file,
166+
# Set ``credentials_file`` to ``None`` here as
167+
# the credentials that we saved earlier should be used.
168+
credentials_file=None,
166169
scopes=self._scopes,
167170
ssl_credentials=self._ssl_channel_credentials,
168171
quota_project_id=quota_project_id,
@@ -235,7 +238,7 @@ def operations_client(self) -> operations_v1.OperationsClient:
235238
This property caches on the instance; repeated calls return the same
236239
client.
237240
"""
238-
# Sanity check: Only create a new client if we do not already have one.
241+
# Quick check: Only create a new client if we do not already have one.
239242
if self._operations_client is None:
240243
self._operations_client = operations_v1.OperationsClient(self.grpc_channel)
241244

@@ -404,11 +407,11 @@ def batch_translate_document(
404407
r"""Return a callable for the batch translate document method over gRPC.
405408
406409
Translates a large volume of documents in
407-
asynchronous batch mode. This function provides real-
408-
time output as the inputs are being processed. If caller
409-
cancels a request, the partial results (for an input
410-
file, it's all or nothing) may still be available on the
411-
specified output location.
410+
asynchronous batch mode. This function provides
411+
real-time output as the inputs are being processed. If
412+
caller cancels a request, the partial results (for an
413+
input file, it's all or nothing) may still be available
414+
on the specified output location.
412415
This call returns immediately and you can use
413416
google.longrunning.Operation.name to poll the status of
414417
the call.

0 commit comments

Comments
 (0)