@@ -247,7 +247,7 @@ async def translate_text(
247247 # and friendly error handling.
248248 rpc = gapic_v1 .method_async .wrap_method (
249249 self ._client ._transport .translate_text ,
250- default_timeout = None ,
250+ default_timeout = 600.0 ,
251251 client_info = _client_info ,
252252 )
253253
@@ -367,7 +367,7 @@ async def detect_language(
367367 # and friendly error handling.
368368 rpc = gapic_v1 .method_async .wrap_method (
369369 self ._client ._transport .detect_language ,
370- default_timeout = None ,
370+ default_timeout = 600.0 ,
371371 client_info = _client_info ,
372372 )
373373
@@ -485,7 +485,15 @@ async def get_supported_languages(
485485 # and friendly error handling.
486486 rpc = gapic_v1 .method_async .wrap_method (
487487 self ._client ._transport .get_supported_languages ,
488- default_timeout = None ,
488+ default_retry = retries .Retry (
489+ initial = 0.1 ,
490+ maximum = 60.0 ,
491+ multiplier = 1.3 ,
492+ predicate = retries .if_exception_type (
493+ exceptions .DeadlineExceeded , exceptions .ServiceUnavailable ,
494+ ),
495+ ),
496+ default_timeout = 600.0 ,
489497 client_info = _client_info ,
490498 )
491499
@@ -549,7 +557,7 @@ async def batch_translate_text(
549557 # and friendly error handling.
550558 rpc = gapic_v1 .method_async .wrap_method (
551559 self ._client ._transport .batch_translate_text ,
552- default_timeout = None ,
560+ default_timeout = 600.0 ,
553561 client_info = _client_info ,
554562 )
555563
@@ -638,7 +646,7 @@ async def create_glossary(
638646 # and friendly error handling.
639647 rpc = gapic_v1 .method_async .wrap_method (
640648 self ._client ._transport .create_glossary ,
641- default_timeout = None ,
649+ default_timeout = 600.0 ,
642650 client_info = _client_info ,
643651 )
644652
@@ -720,7 +728,15 @@ async def list_glossaries(
720728 # and friendly error handling.
721729 rpc = gapic_v1 .method_async .wrap_method (
722730 self ._client ._transport .list_glossaries ,
723- default_timeout = None ,
731+ default_retry = retries .Retry (
732+ initial = 0.1 ,
733+ maximum = 60.0 ,
734+ multiplier = 1.3 ,
735+ predicate = retries .if_exception_type (
736+ exceptions .DeadlineExceeded , exceptions .ServiceUnavailable ,
737+ ),
738+ ),
739+ default_timeout = 600.0 ,
724740 client_info = _client_info ,
725741 )
726742
@@ -797,7 +813,15 @@ async def get_glossary(
797813 # and friendly error handling.
798814 rpc = gapic_v1 .method_async .wrap_method (
799815 self ._client ._transport .get_glossary ,
800- default_timeout = None ,
816+ default_retry = retries .Retry (
817+ initial = 0.1 ,
818+ maximum = 60.0 ,
819+ multiplier = 1.3 ,
820+ predicate = retries .if_exception_type (
821+ exceptions .DeadlineExceeded , exceptions .ServiceUnavailable ,
822+ ),
823+ ),
824+ default_timeout = 600.0 ,
801825 client_info = _client_info ,
802826 )
803827
@@ -874,7 +898,15 @@ async def delete_glossary(
874898 # and friendly error handling.
875899 rpc = gapic_v1 .method_async .wrap_method (
876900 self ._client ._transport .delete_glossary ,
877- default_timeout = None ,
901+ default_retry = retries .Retry (
902+ initial = 0.1 ,
903+ maximum = 60.0 ,
904+ multiplier = 1.3 ,
905+ predicate = retries .if_exception_type (
906+ exceptions .DeadlineExceeded , exceptions .ServiceUnavailable ,
907+ ),
908+ ),
909+ default_timeout = 600.0 ,
878910 client_info = _client_info ,
879911 )
880912
@@ -901,9 +933,7 @@ async def delete_glossary(
901933
902934try :
903935 _client_info = gapic_v1 .client_info .ClientInfo (
904- gapic_version = pkg_resources .get_distribution (
905- "google-cloud-translation" ,
906- ).version ,
936+ gapic_version = pkg_resources .get_distribution ("google-cloud-translate" ,).version ,
907937 )
908938except pkg_resources .DistributionNotFound :
909939 _client_info = gapic_v1 .client_info .ClientInfo ()
0 commit comments