@@ -9,6 +9,7 @@ from typing import Callable, Dict, Optional, Sequence, Tuple
99from google.api_core import operations_v1
1010{% endif %}
1111from google.api_core import gapic_v1 # type: ignore
12+ from google.api_core import retry as retries # type: ignore
1213from google.api_core import exceptions as core_exceptions # type: ignore
1314from google.auth import credentials as ga_credentials # type: ignore
1415from google.auth.transport.grpc import SslCredentials # type: ignore
@@ -134,6 +135,8 @@ class {{ service.name }}RestTransport({{ service.name }}Transport):
134135
135136 def {{ method.name|snake_case }}(self,
136137 request: {{ method.input.ident }}, *,
138+ retry: retries.Retry = gapic_v1.method.DEFAULT,
139+ timeout: float = None,
137140 metadata: Sequence[Tuple[str, str]] = (),
138141 ) -> {{ method.output.ident }}:
139142 r"""Call the {{- ' ' -}}
@@ -145,6 +148,9 @@ class {{ service.name }}RestTransport({{ service.name }}Transport):
145148 request (~.{{ method.input.ident }}):
146149 The request object.{{ ' ' }}
147150 {{- method.input.meta.doc|rst(width=72, indent=16) }}
151+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
152+ should be retried.
153+ timeout (float): The timeout for this request.
148154 metadata (Sequence[Tuple[str, str]]): Strings which should be
149155 sent along with the request as metadata.
150156 {% if not method .void %}
@@ -207,6 +213,7 @@ class {{ service.name }}RestTransport({{ service.name }}Transport):
207213 headers['Content-Type'] = 'application/json'
208214 response = self._session.{{ method.http_opt['verb'] }}(
209215 url,
216+ timeout=timeout,
210217 headers=headers,
211218 params=query_params,
212219 {% if 'body' in method .http_opt %}
0 commit comments