|
15 | 15 | from __future__ import absolute_import |
16 | 16 | import sys |
17 | 17 |
|
18 | | -from google.api_core.protobuf_helpers import get_messages |
19 | | - |
20 | 18 | from google.api import http_pb2 |
21 | | -from google.cloud.tasks_v2beta2.proto import cloudtasks_pb2 |
22 | | -from google.cloud.tasks_v2beta2.proto import queue_pb2 |
23 | | -from google.cloud.tasks_v2beta2.proto import target_pb2 |
24 | | -from google.cloud.tasks_v2beta2.proto import task_pb2 |
25 | 19 | from google.iam.v1 import iam_policy_pb2 |
26 | 20 | from google.iam.v1 import policy_pb2 |
27 | 21 | from google.protobuf import any_pb2 |
|
32 | 26 | from google.protobuf import timestamp_pb2 |
33 | 27 | from google.rpc import status_pb2 |
34 | 28 |
|
| 29 | +from google.api_core.protobuf_helpers import get_messages |
| 30 | +from google.cloud.tasks_v2beta2.proto import cloudtasks_pb2 |
| 31 | +from google.cloud.tasks_v2beta2.proto import queue_pb2 |
| 32 | +from google.cloud.tasks_v2beta2.proto import target_pb2 |
| 33 | +from google.cloud.tasks_v2beta2.proto import task_pb2 |
| 34 | + |
| 35 | + |
| 36 | +_shared_modules = [ |
| 37 | + http_pb2, |
| 38 | + iam_policy_pb2, |
| 39 | + policy_pb2, |
| 40 | + any_pb2, |
| 41 | + descriptor_pb2, |
| 42 | + duration_pb2, |
| 43 | + empty_pb2, |
| 44 | + field_mask_pb2, |
| 45 | + timestamp_pb2, |
| 46 | + status_pb2, |
| 47 | +] |
| 48 | + |
| 49 | +_local_modules = [ |
| 50 | + cloudtasks_pb2, |
| 51 | + queue_pb2, |
| 52 | + target_pb2, |
| 53 | + task_pb2, |
| 54 | +] |
| 55 | + |
35 | 56 | names = [] |
36 | | -for module in ( |
37 | | - http_pb2, |
38 | | - cloudtasks_pb2, |
39 | | - queue_pb2, |
40 | | - target_pb2, |
41 | | - task_pb2, |
42 | | - iam_policy_pb2, |
43 | | - policy_pb2, |
44 | | - any_pb2, |
45 | | - descriptor_pb2, |
46 | | - duration_pb2, |
47 | | - empty_pb2, |
48 | | - field_mask_pb2, |
49 | | - timestamp_pb2, |
50 | | - status_pb2, |
51 | | -): |
| 57 | + |
| 58 | +for module in _shared_modules: |
| 59 | + for name, message in get_messages(module).items(): |
| 60 | + setattr(sys.modules[__name__], name, message) |
| 61 | + names.append(name) |
| 62 | + |
| 63 | +for module in _local_modules: |
52 | 64 | for name, message in get_messages(module).items(): |
53 | 65 | message.__module__ = 'google.cloud.tasks_v2beta2.types' |
54 | 66 | setattr(sys.modules[__name__], name, message) |
|
0 commit comments