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 .dataflow_v1beta3 .services .jobs_v1_beta3 import pagers
30
32
from google .cloud .dataflow_v1beta3 .types import environment
31
33
from google .cloud .dataflow_v1beta3 .types import jobs
@@ -164,9 +166,9 @@ def __init__(
164
166
165
167
async def create_job (
166
168
self ,
167
- request : jobs .CreateJobRequest = None ,
169
+ request : Union [ jobs .CreateJobRequest , dict ] = None ,
168
170
* ,
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
) -> jobs .Job :
@@ -179,7 +181,7 @@ async def create_job(
179
181
will always start in ``us-central1``.
180
182
181
183
Args:
182
- request (:class:` google.cloud.dataflow_v1beta3.types.CreateJobRequest` ):
184
+ request (Union[ google.cloud.dataflow_v1beta3.types.CreateJobRequest, dict] ):
183
185
The request object. Request to create a Cloud Dataflow
184
186
job.
185
187
retry (google.api_core.retry.Retry): Designation of what errors, if any,
@@ -213,9 +215,9 @@ async def create_job(
213
215
214
216
async def get_job (
215
217
self ,
216
- request : jobs .GetJobRequest = None ,
218
+ request : Union [ jobs .GetJobRequest , dict ] = None ,
217
219
* ,
218
- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
220
+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
219
221
timeout : float = None ,
220
222
metadata : Sequence [Tuple [str , str ]] = (),
221
223
) -> jobs .Job :
@@ -228,7 +230,7 @@ async def get_job(
228
230
get the state of jobs that are running in ``us-central1``.
229
231
230
232
Args:
231
- request (:class:` google.cloud.dataflow_v1beta3.types.GetJobRequest` ):
233
+ request (Union[ google.cloud.dataflow_v1beta3.types.GetJobRequest, dict] ):
232
234
The request object. Request to get the state of a Cloud
233
235
Dataflow job.
234
236
retry (google.api_core.retry.Retry): Designation of what errors, if any,
@@ -262,9 +264,9 @@ async def get_job(
262
264
263
265
async def update_job (
264
266
self ,
265
- request : jobs .UpdateJobRequest = None ,
267
+ request : Union [ jobs .UpdateJobRequest , dict ] = None ,
266
268
* ,
267
- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
269
+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
268
270
timeout : float = None ,
269
271
metadata : Sequence [Tuple [str , str ]] = (),
270
272
) -> jobs .Job :
@@ -278,7 +280,7 @@ async def update_job(
278
280
``us-central1``.
279
281
280
282
Args:
281
- request (:class:` google.cloud.dataflow_v1beta3.types.UpdateJobRequest` ):
283
+ request (Union[ google.cloud.dataflow_v1beta3.types.UpdateJobRequest, dict] ):
282
284
The request object. Request to update a Cloud Dataflow
283
285
job.
284
286
retry (google.api_core.retry.Retry): Designation of what errors, if any,
@@ -312,9 +314,9 @@ async def update_job(
312
314
313
315
async def list_jobs (
314
316
self ,
315
- request : jobs .ListJobsRequest = None ,
317
+ request : Union [ jobs .ListJobsRequest , dict ] = None ,
316
318
* ,
317
- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
319
+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
318
320
timeout : float = None ,
319
321
metadata : Sequence [Tuple [str , str ]] = (),
320
322
) -> pagers .ListJobsAsyncPager :
@@ -329,7 +331,7 @@ async def list_jobs(
329
331
running in ``us-central1``.
330
332
331
333
Args:
332
- request (:class:` google.cloud.dataflow_v1beta3.types.ListJobsRequest` ):
334
+ request (Union[ google.cloud.dataflow_v1beta3.types.ListJobsRequest, dict] ):
333
335
The request object. Request to list Cloud Dataflow jobs.
334
336
retry (google.api_core.retry.Retry): Designation of what errors, if any,
335
337
should be retried.
@@ -378,16 +380,16 @@ async def list_jobs(
378
380
379
381
async def aggregated_list_jobs (
380
382
self ,
381
- request : jobs .ListJobsRequest = None ,
383
+ request : Union [ jobs .ListJobsRequest , dict ] = None ,
382
384
* ,
383
- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
385
+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
384
386
timeout : float = None ,
385
387
metadata : Sequence [Tuple [str , str ]] = (),
386
388
) -> pagers .AggregatedListJobsAsyncPager :
387
389
r"""List the jobs of a project across all regions.
388
390
389
391
Args:
390
- request (:class:` google.cloud.dataflow_v1beta3.types.ListJobsRequest` ):
392
+ request (Union[ google.cloud.dataflow_v1beta3.types.ListJobsRequest, dict] ):
391
393
The request object. Request to list Cloud Dataflow jobs.
392
394
retry (google.api_core.retry.Retry): Designation of what errors, if any,
393
395
should be retried.
@@ -436,17 +438,17 @@ async def aggregated_list_jobs(
436
438
437
439
async def check_active_jobs (
438
440
self ,
439
- request : jobs .CheckActiveJobsRequest = None ,
441
+ request : Union [ jobs .CheckActiveJobsRequest , dict ] = None ,
440
442
* ,
441
- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
443
+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
442
444
timeout : float = None ,
443
445
metadata : Sequence [Tuple [str , str ]] = (),
444
446
) -> jobs .CheckActiveJobsResponse :
445
447
r"""Check for existence of active jobs in the given
446
448
project across all regions.
447
449
448
450
Args:
449
- request (:class:` google.cloud.dataflow_v1beta3.types.CheckActiveJobsRequest` ):
451
+ request (Union[ google.cloud.dataflow_v1beta3.types.CheckActiveJobsRequest, dict] ):
450
452
The request object. Request to check is active jobs
451
453
exists for a project
452
454
retry (google.api_core.retry.Retry): Designation of what errors, if any,
@@ -478,16 +480,16 @@ async def check_active_jobs(
478
480
479
481
async def snapshot_job (
480
482
self ,
481
- request : jobs .SnapshotJobRequest = None ,
483
+ request : Union [ jobs .SnapshotJobRequest , dict ] = None ,
482
484
* ,
483
- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
485
+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
484
486
timeout : float = None ,
485
487
metadata : Sequence [Tuple [str , str ]] = (),
486
488
) -> snapshots .Snapshot :
487
489
r"""Snapshot the state of a streaming job.
488
490
489
491
Args:
490
- request (:class:` google.cloud.dataflow_v1beta3.types.SnapshotJobRequest` ):
492
+ request (Union[ google.cloud.dataflow_v1beta3.types.SnapshotJobRequest, dict] ):
491
493
The request object. Request to create a snapshot of a
492
494
job.
493
495
retry (google.api_core.retry.Retry): Designation of what errors, if any,
0 commit comments