1313# See the License for the specific language governing permissions and
1414# limitations under the License.
1515#
16+ from google .api_core import gapic_v1
17+ from google .api_core import retry as retries
18+ from google .api_core import retry_async as retries_async
1619from typing import (
1720 Any ,
1821 AsyncIterator ,
2225 Tuple ,
2326 Optional ,
2427 Iterator ,
28+ Union ,
2529)
2630
31+ try :
32+ OptionalRetry = Union [retries .Retry , gapic_v1 .method ._MethodDefault , None ]
33+ OptionalAsyncRetry = Union [
34+ retries_async .AsyncRetry , gapic_v1 .method ._MethodDefault , None
35+ ]
36+ except AttributeError : # pragma: NO COVER
37+ OptionalRetry = Union [retries .Retry , object , None ] # type: ignore
38+ OptionalAsyncRetry = Union [retries_async .AsyncRetry , object , None ] # type: ignore
39+
2740from google .cloud .errorreporting_v1beta1 .types import common
2841from google .cloud .errorreporting_v1beta1 .types import error_stats_service
2942
@@ -52,6 +65,8 @@ def __init__(
5265 request : error_stats_service .ListGroupStatsRequest ,
5366 response : error_stats_service .ListGroupStatsResponse ,
5467 * ,
68+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
69+ timeout : Union [float , object ] = gapic_v1 .method .DEFAULT ,
5570 metadata : Sequence [Tuple [str , str ]] = ()
5671 ):
5772 """Instantiate the pager.
@@ -63,12 +78,17 @@ def __init__(
6378 The initial request object.
6479 response (google.cloud.errorreporting_v1beta1.types.ListGroupStatsResponse):
6580 The initial response object.
81+ retry (google.api_core.retry.Retry): Designation of what errors,
82+ if any, should be retried.
83+ timeout (float): The timeout for this request.
6684 metadata (Sequence[Tuple[str, str]]): Strings which should be
6785 sent along with the request as metadata.
6886 """
6987 self ._method = method
7088 self ._request = error_stats_service .ListGroupStatsRequest (request )
7189 self ._response = response
90+ self ._retry = retry
91+ self ._timeout = timeout
7292 self ._metadata = metadata
7393
7494 def __getattr__ (self , name : str ) -> Any :
@@ -79,7 +99,12 @@ def pages(self) -> Iterator[error_stats_service.ListGroupStatsResponse]:
7999 yield self ._response
80100 while self ._response .next_page_token :
81101 self ._request .page_token = self ._response .next_page_token
82- self ._response = self ._method (self ._request , metadata = self ._metadata )
102+ self ._response = self ._method (
103+ self ._request ,
104+ retry = self ._retry ,
105+ timeout = self ._timeout ,
106+ metadata = self ._metadata ,
107+ )
83108 yield self ._response
84109
85110 def __iter__ (self ) -> Iterator [error_stats_service .ErrorGroupStats ]:
@@ -114,6 +139,8 @@ def __init__(
114139 request : error_stats_service .ListGroupStatsRequest ,
115140 response : error_stats_service .ListGroupStatsResponse ,
116141 * ,
142+ retry : OptionalAsyncRetry = gapic_v1 .method .DEFAULT ,
143+ timeout : Union [float , object ] = gapic_v1 .method .DEFAULT ,
117144 metadata : Sequence [Tuple [str , str ]] = ()
118145 ):
119146 """Instantiates the pager.
@@ -125,12 +152,17 @@ def __init__(
125152 The initial request object.
126153 response (google.cloud.errorreporting_v1beta1.types.ListGroupStatsResponse):
127154 The initial response object.
155+ retry (google.api_core.retry.AsyncRetry): Designation of what errors,
156+ if any, should be retried.
157+ timeout (float): The timeout for this request.
128158 metadata (Sequence[Tuple[str, str]]): Strings which should be
129159 sent along with the request as metadata.
130160 """
131161 self ._method = method
132162 self ._request = error_stats_service .ListGroupStatsRequest (request )
133163 self ._response = response
164+ self ._retry = retry
165+ self ._timeout = timeout
134166 self ._metadata = metadata
135167
136168 def __getattr__ (self , name : str ) -> Any :
@@ -141,7 +173,12 @@ async def pages(self) -> AsyncIterator[error_stats_service.ListGroupStatsRespons
141173 yield self ._response
142174 while self ._response .next_page_token :
143175 self ._request .page_token = self ._response .next_page_token
144- self ._response = await self ._method (self ._request , metadata = self ._metadata )
176+ self ._response = await self ._method (
177+ self ._request ,
178+ retry = self ._retry ,
179+ timeout = self ._timeout ,
180+ metadata = self ._metadata ,
181+ )
145182 yield self ._response
146183
147184 def __aiter__ (self ) -> AsyncIterator [error_stats_service .ErrorGroupStats ]:
@@ -180,6 +217,8 @@ def __init__(
180217 request : error_stats_service .ListEventsRequest ,
181218 response : error_stats_service .ListEventsResponse ,
182219 * ,
220+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
221+ timeout : Union [float , object ] = gapic_v1 .method .DEFAULT ,
183222 metadata : Sequence [Tuple [str , str ]] = ()
184223 ):
185224 """Instantiate the pager.
@@ -191,12 +230,17 @@ def __init__(
191230 The initial request object.
192231 response (google.cloud.errorreporting_v1beta1.types.ListEventsResponse):
193232 The initial response object.
233+ retry (google.api_core.retry.Retry): Designation of what errors,
234+ if any, should be retried.
235+ timeout (float): The timeout for this request.
194236 metadata (Sequence[Tuple[str, str]]): Strings which should be
195237 sent along with the request as metadata.
196238 """
197239 self ._method = method
198240 self ._request = error_stats_service .ListEventsRequest (request )
199241 self ._response = response
242+ self ._retry = retry
243+ self ._timeout = timeout
200244 self ._metadata = metadata
201245
202246 def __getattr__ (self , name : str ) -> Any :
@@ -207,7 +251,12 @@ def pages(self) -> Iterator[error_stats_service.ListEventsResponse]:
207251 yield self ._response
208252 while self ._response .next_page_token :
209253 self ._request .page_token = self ._response .next_page_token
210- self ._response = self ._method (self ._request , metadata = self ._metadata )
254+ self ._response = self ._method (
255+ self ._request ,
256+ retry = self ._retry ,
257+ timeout = self ._timeout ,
258+ metadata = self ._metadata ,
259+ )
211260 yield self ._response
212261
213262 def __iter__ (self ) -> Iterator [common .ErrorEvent ]:
@@ -242,6 +291,8 @@ def __init__(
242291 request : error_stats_service .ListEventsRequest ,
243292 response : error_stats_service .ListEventsResponse ,
244293 * ,
294+ retry : OptionalAsyncRetry = gapic_v1 .method .DEFAULT ,
295+ timeout : Union [float , object ] = gapic_v1 .method .DEFAULT ,
245296 metadata : Sequence [Tuple [str , str ]] = ()
246297 ):
247298 """Instantiates the pager.
@@ -253,12 +304,17 @@ def __init__(
253304 The initial request object.
254305 response (google.cloud.errorreporting_v1beta1.types.ListEventsResponse):
255306 The initial response object.
307+ retry (google.api_core.retry.AsyncRetry): Designation of what errors,
308+ if any, should be retried.
309+ timeout (float): The timeout for this request.
256310 metadata (Sequence[Tuple[str, str]]): Strings which should be
257311 sent along with the request as metadata.
258312 """
259313 self ._method = method
260314 self ._request = error_stats_service .ListEventsRequest (request )
261315 self ._response = response
316+ self ._retry = retry
317+ self ._timeout = timeout
262318 self ._metadata = metadata
263319
264320 def __getattr__ (self , name : str ) -> Any :
@@ -269,7 +325,12 @@ async def pages(self) -> AsyncIterator[error_stats_service.ListEventsResponse]:
269325 yield self ._response
270326 while self ._response .next_page_token :
271327 self ._request .page_token = self ._response .next_page_token
272- self ._response = await self ._method (self ._request , metadata = self ._metadata )
328+ self ._response = await self ._method (
329+ self ._request ,
330+ retry = self ._retry ,
331+ timeout = self ._timeout ,
332+ metadata = self ._metadata ,
333+ )
273334 yield self ._response
274335
275336 def __aiter__ (self ) -> AsyncIterator [common .ErrorEvent ]:
0 commit comments