@@ -45,9 +45,47 @@ class LanguageServiceAsyncClient:
4545 DEFAULT_ENDPOINT = LanguageServiceClient .DEFAULT_ENDPOINT
4646 DEFAULT_MTLS_ENDPOINT = LanguageServiceClient .DEFAULT_MTLS_ENDPOINT
4747
48+ common_billing_account_path = staticmethod (
49+ LanguageServiceClient .common_billing_account_path
50+ )
51+ parse_common_billing_account_path = staticmethod (
52+ LanguageServiceClient .parse_common_billing_account_path
53+ )
54+
55+ common_folder_path = staticmethod (LanguageServiceClient .common_folder_path )
56+ parse_common_folder_path = staticmethod (
57+ LanguageServiceClient .parse_common_folder_path
58+ )
59+
60+ common_organization_path = staticmethod (
61+ LanguageServiceClient .common_organization_path
62+ )
63+ parse_common_organization_path = staticmethod (
64+ LanguageServiceClient .parse_common_organization_path
65+ )
66+
67+ common_project_path = staticmethod (LanguageServiceClient .common_project_path )
68+ parse_common_project_path = staticmethod (
69+ LanguageServiceClient .parse_common_project_path
70+ )
71+
72+ common_location_path = staticmethod (LanguageServiceClient .common_location_path )
73+ parse_common_location_path = staticmethod (
74+ LanguageServiceClient .parse_common_location_path
75+ )
76+
4877 from_service_account_file = LanguageServiceClient .from_service_account_file
4978 from_service_account_json = from_service_account_file
5079
80+ @property
81+ def transport (self ) -> LanguageServiceTransport :
82+ """Return the transport used by the client instance.
83+
84+ Returns:
85+ LanguageServiceTransport: The transport used by the client instance.
86+ """
87+ return self ._client .transport
88+
5189 get_transport_class = functools .partial (
5290 type (LanguageServiceClient ).get_transport_class , type (LanguageServiceClient )
5391 )
@@ -143,7 +181,8 @@ async def analyze_sentiment(
143181 # Create or coerce a protobuf request object.
144182 # Sanity check: If we got a request object, we should *not* have
145183 # gotten any keyword arguments that map to the request.
146- if request is not None and any ([document , encoding_type ]):
184+ has_flattened_params = any ([document , encoding_type ])
185+ if request is not None and has_flattened_params :
147186 raise ValueError (
148187 "If the `request` argument is set, then none of "
149188 "the individual field arguments should be set."
@@ -168,7 +207,7 @@ async def analyze_sentiment(
168207 maximum = 60.0 ,
169208 multiplier = 1.3 ,
170209 predicate = retries .if_exception_type (
171- exceptions .ServiceUnavailable , exceptions .DeadlineExceeded ,
210+ exceptions .DeadlineExceeded , exceptions .ServiceUnavailable ,
172211 ),
173212 ),
174213 default_timeout = 600.0 ,
@@ -224,7 +263,8 @@ async def analyze_entities(
224263 # Create or coerce a protobuf request object.
225264 # Sanity check: If we got a request object, we should *not* have
226265 # gotten any keyword arguments that map to the request.
227- if request is not None and any ([document , encoding_type ]):
266+ has_flattened_params = any ([document , encoding_type ])
267+ if request is not None and has_flattened_params :
228268 raise ValueError (
229269 "If the `request` argument is set, then none of "
230270 "the individual field arguments should be set."
@@ -249,7 +289,7 @@ async def analyze_entities(
249289 maximum = 60.0 ,
250290 multiplier = 1.3 ,
251291 predicate = retries .if_exception_type (
252- exceptions .ServiceUnavailable , exceptions .DeadlineExceeded ,
292+ exceptions .DeadlineExceeded , exceptions .ServiceUnavailable ,
253293 ),
254294 ),
255295 default_timeout = 600.0 ,
@@ -308,7 +348,8 @@ async def analyze_entity_sentiment(
308348 # Create or coerce a protobuf request object.
309349 # Sanity check: If we got a request object, we should *not* have
310350 # gotten any keyword arguments that map to the request.
311- if request is not None and any ([document , encoding_type ]):
351+ has_flattened_params = any ([document , encoding_type ])
352+ if request is not None and has_flattened_params :
312353 raise ValueError (
313354 "If the `request` argument is set, then none of "
314355 "the individual field arguments should be set."
@@ -333,7 +374,7 @@ async def analyze_entity_sentiment(
333374 maximum = 60.0 ,
334375 multiplier = 1.3 ,
335376 predicate = retries .if_exception_type (
336- exceptions .ServiceUnavailable , exceptions .DeadlineExceeded ,
377+ exceptions .DeadlineExceeded , exceptions .ServiceUnavailable ,
337378 ),
338379 ),
339380 default_timeout = 600.0 ,
@@ -388,7 +429,8 @@ async def analyze_syntax(
388429 # Create or coerce a protobuf request object.
389430 # Sanity check: If we got a request object, we should *not* have
390431 # gotten any keyword arguments that map to the request.
391- if request is not None and any ([document , encoding_type ]):
432+ has_flattened_params = any ([document , encoding_type ])
433+ if request is not None and has_flattened_params :
392434 raise ValueError (
393435 "If the `request` argument is set, then none of "
394436 "the individual field arguments should be set."
@@ -413,7 +455,7 @@ async def analyze_syntax(
413455 maximum = 60.0 ,
414456 multiplier = 1.3 ,
415457 predicate = retries .if_exception_type (
416- exceptions .ServiceUnavailable , exceptions .DeadlineExceeded ,
458+ exceptions .DeadlineExceeded , exceptions .ServiceUnavailable ,
417459 ),
418460 ),
419461 default_timeout = 600.0 ,
@@ -462,7 +504,8 @@ async def classify_text(
462504 # Create or coerce a protobuf request object.
463505 # Sanity check: If we got a request object, we should *not* have
464506 # gotten any keyword arguments that map to the request.
465- if request is not None and any ([document ]):
507+ has_flattened_params = any ([document ])
508+ if request is not None and has_flattened_params :
466509 raise ValueError (
467510 "If the `request` argument is set, then none of "
468511 "the individual field arguments should be set."
@@ -485,7 +528,7 @@ async def classify_text(
485528 maximum = 60.0 ,
486529 multiplier = 1.3 ,
487530 predicate = retries .if_exception_type (
488- exceptions .ServiceUnavailable , exceptions .DeadlineExceeded ,
531+ exceptions .DeadlineExceeded , exceptions .ServiceUnavailable ,
489532 ),
490533 ),
491534 default_timeout = 600.0 ,
@@ -550,7 +593,8 @@ async def annotate_text(
550593 # Create or coerce a protobuf request object.
551594 # Sanity check: If we got a request object, we should *not* have
552595 # gotten any keyword arguments that map to the request.
553- if request is not None and any ([document , features , encoding_type ]):
596+ has_flattened_params = any ([document , features , encoding_type ])
597+ if request is not None and has_flattened_params :
554598 raise ValueError (
555599 "If the `request` argument is set, then none of "
556600 "the individual field arguments should be set."
@@ -577,7 +621,7 @@ async def annotate_text(
577621 maximum = 60.0 ,
578622 multiplier = 1.3 ,
579623 predicate = retries .if_exception_type (
580- exceptions .ServiceUnavailable , exceptions .DeadlineExceeded ,
624+ exceptions .DeadlineExceeded , exceptions .ServiceUnavailable ,
581625 ),
582626 ),
583627 default_timeout = 600.0 ,
0 commit comments