19
19
from typing import Dict , Sequence , Tuple , Type , Union
20
20
import pkg_resources
21
21
22
- import google .api_core .client_options as ClientOptions # type: ignore
22
+ from google .api_core .client_options import ClientOptions # type: ignore
23
23
from google .api_core import exceptions as core_exceptions # type: ignore
24
24
from google .api_core import gapic_v1 # type: ignore
25
25
from google .api_core import retry as retries # type: ignore
26
26
from google .auth import credentials as ga_credentials # type: ignore
27
27
from google .oauth2 import service_account # type: ignore
28
28
29
+ OptionalRetry = Union [retries .Retry , object ]
30
+
29
31
from google .cloud .workflows .executions_v1beta .services .executions import pagers
30
32
from google .cloud .workflows .executions_v1beta .types import executions
31
33
from google .protobuf import timestamp_pb2 # type: ignore
@@ -163,10 +165,10 @@ def __init__(
163
165
164
166
async def list_executions (
165
167
self ,
166
- request : executions .ListExecutionsRequest = None ,
168
+ request : Union [ executions .ListExecutionsRequest , dict ] = None ,
167
169
* ,
168
170
parent : str = None ,
169
- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
171
+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
170
172
timeout : float = None ,
171
173
metadata : Sequence [Tuple [str , str ]] = (),
172
174
) -> pagers .ListExecutionsAsyncPager :
@@ -177,7 +179,7 @@ async def list_executions(
177
179
first).
178
180
179
181
Args:
180
- request (:class:` google.cloud.workflows.executions_v1beta.types.ListExecutionsRequest` ):
182
+ request (Union[ google.cloud.workflows.executions_v1beta.types.ListExecutionsRequest, dict] ):
181
183
The request object. Request for the
182
184
[ListExecutions][google.cloud.workflows.executions.v1beta.Executions.ListExecutions]
183
185
method.
@@ -251,19 +253,19 @@ async def list_executions(
251
253
252
254
async def create_execution (
253
255
self ,
254
- request : executions .CreateExecutionRequest = None ,
256
+ request : Union [ executions .CreateExecutionRequest , dict ] = None ,
255
257
* ,
256
258
parent : str = None ,
257
259
execution : executions .Execution = None ,
258
- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
260
+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
259
261
timeout : float = None ,
260
262
metadata : Sequence [Tuple [str , str ]] = (),
261
263
) -> executions .Execution :
262
264
r"""Creates a new execution using the latest revision of
263
265
the given workflow.
264
266
265
267
Args:
266
- request (:class:` google.cloud.workflows.executions_v1beta.types.CreateExecutionRequest` ):
268
+ request (Union[ google.cloud.workflows.executions_v1beta.types.CreateExecutionRequest, dict] ):
267
269
The request object. Request for the
268
270
[CreateExecution][google.cloud.workflows.executions.v1beta.Executions.CreateExecution]
269
271
method.
@@ -336,17 +338,17 @@ async def create_execution(
336
338
337
339
async def get_execution (
338
340
self ,
339
- request : executions .GetExecutionRequest = None ,
341
+ request : Union [ executions .GetExecutionRequest , dict ] = None ,
340
342
* ,
341
343
name : str = None ,
342
- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
344
+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
343
345
timeout : float = None ,
344
346
metadata : Sequence [Tuple [str , str ]] = (),
345
347
) -> executions .Execution :
346
348
r"""Returns an execution of the given name.
347
349
348
350
Args:
349
- request (:class:` google.cloud.workflows.executions_v1beta.types.GetExecutionRequest` ):
351
+ request (Union[ google.cloud.workflows.executions_v1beta.types.GetExecutionRequest, dict] ):
350
352
The request object. Request for the
351
353
[GetExecution][google.cloud.workflows.executions.v1beta.Executions.GetExecution]
352
354
method.
@@ -409,17 +411,17 @@ async def get_execution(
409
411
410
412
async def cancel_execution (
411
413
self ,
412
- request : executions .CancelExecutionRequest = None ,
414
+ request : Union [ executions .CancelExecutionRequest , dict ] = None ,
413
415
* ,
414
416
name : str = None ,
415
- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
417
+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
416
418
timeout : float = None ,
417
419
metadata : Sequence [Tuple [str , str ]] = (),
418
420
) -> executions .Execution :
419
421
r"""Cancels an execution of the given name.
420
422
421
423
Args:
422
- request (:class:` google.cloud.workflows.executions_v1beta.types.CancelExecutionRequest` ):
424
+ request (Union[ google.cloud.workflows.executions_v1beta.types.CancelExecutionRequest, dict] ):
423
425
The request object. Request for the
424
426
[CancelExecution][google.cloud.workflows.executions.v1beta.Executions.CancelExecution]
425
427
method.
0 commit comments