sift-stack-py 0.3.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (291) hide show
  1. google/__init__.py +1 -0
  2. google/api/__init__.py +0 -0
  3. google/api/annotations_pb2.py +27 -0
  4. google/api/annotations_pb2.pyi +29 -0
  5. google/api/annotations_pb2_grpc.py +4 -0
  6. google/api/annotations_pb2_grpc.pyi +30 -0
  7. google/api/field_behavior_pb2.py +30 -0
  8. google/api/field_behavior_pb2.pyi +175 -0
  9. google/api/field_behavior_pb2_grpc.py +4 -0
  10. google/api/field_behavior_pb2_grpc.pyi +30 -0
  11. google/api/http_pb2.py +31 -0
  12. google/api/http_pb2.pyi +433 -0
  13. google/api/http_pb2_grpc.py +4 -0
  14. google/api/http_pb2_grpc.pyi +30 -0
  15. protoc_gen_openapiv2/__init__.py +0 -0
  16. protoc_gen_openapiv2/options/__init__.py +0 -0
  17. protoc_gen_openapiv2/options/annotations_pb2.py +27 -0
  18. protoc_gen_openapiv2/options/annotations_pb2.pyi +48 -0
  19. protoc_gen_openapiv2/options/annotations_pb2_grpc.py +4 -0
  20. protoc_gen_openapiv2/options/annotations_pb2_grpc.pyi +17 -0
  21. protoc_gen_openapiv2/options/openapiv2_pb2.py +132 -0
  22. protoc_gen_openapiv2/options/openapiv2_pb2.pyi +1533 -0
  23. protoc_gen_openapiv2/options/openapiv2_pb2_grpc.py +4 -0
  24. protoc_gen_openapiv2/options/openapiv2_pb2_grpc.pyi +17 -0
  25. sift/__init__.py +0 -0
  26. sift/annotation_logs/__init__.py +0 -0
  27. sift/annotation_logs/v1/__init__.py +0 -0
  28. sift/annotation_logs/v1/annotation_logs_pb2.py +115 -0
  29. sift/annotation_logs/v1/annotation_logs_pb2.pyi +370 -0
  30. sift/annotation_logs/v1/annotation_logs_pb2_grpc.py +135 -0
  31. sift/annotation_logs/v1/annotation_logs_pb2_grpc.pyi +84 -0
  32. sift/annotations/__init__.py +0 -0
  33. sift/annotations/v1/__init__.py +0 -0
  34. sift/annotations/v1/annotations_pb2.py +180 -0
  35. sift/annotations/v1/annotations_pb2.pyi +539 -0
  36. sift/annotations/v1/annotations_pb2_grpc.py +237 -0
  37. sift/annotations/v1/annotations_pb2_grpc.pyi +144 -0
  38. sift/assets/__init__.py +0 -0
  39. sift/assets/v1/__init__.py +0 -0
  40. sift/assets/v1/assets_pb2.py +90 -0
  41. sift/assets/v1/assets_pb2.pyi +235 -0
  42. sift/assets/v1/assets_pb2_grpc.py +168 -0
  43. sift/assets/v1/assets_pb2_grpc.pyi +101 -0
  44. sift/calculated_channels/__init__.py +0 -0
  45. sift/calculated_channels/v1/__init__.py +0 -0
  46. sift/calculated_channels/v1/calculated_channels_pb2.py +99 -0
  47. sift/calculated_channels/v1/calculated_channels_pb2.pyi +280 -0
  48. sift/calculated_channels/v1/calculated_channels_pb2_grpc.py +101 -0
  49. sift/calculated_channels/v1/calculated_channels_pb2_grpc.pyi +64 -0
  50. sift/campaigns/__init__.py +0 -0
  51. sift/campaigns/v1/__init__.py +0 -0
  52. sift/campaigns/v1/campaigns_pb2.py +144 -0
  53. sift/campaigns/v1/campaigns_pb2.pyi +383 -0
  54. sift/campaigns/v1/campaigns_pb2_grpc.py +169 -0
  55. sift/campaigns/v1/campaigns_pb2_grpc.pyi +104 -0
  56. sift/channel_schemas/__init__.py +0 -0
  57. sift/channel_schemas/v1/__init__.py +0 -0
  58. sift/channel_schemas/v1/channel_schemas_pb2.py +69 -0
  59. sift/channel_schemas/v1/channel_schemas_pb2.pyi +117 -0
  60. sift/channel_schemas/v1/channel_schemas_pb2_grpc.py +101 -0
  61. sift/channel_schemas/v1/channel_schemas_pb2_grpc.pyi +64 -0
  62. sift/channels/__init__.py +0 -0
  63. sift/channels/v2/__init__.py +0 -0
  64. sift/channels/v2/channels_pb2.py +88 -0
  65. sift/channels/v2/channels_pb2.pyi +183 -0
  66. sift/channels/v2/channels_pb2_grpc.py +101 -0
  67. sift/channels/v2/channels_pb2_grpc.pyi +64 -0
  68. sift/common/__init__.py +0 -0
  69. sift/common/type/__init__.py +0 -0
  70. sift/common/type/v1/__init__.py +0 -0
  71. sift/common/type/v1/channel_bit_field_element_pb2.py +34 -0
  72. sift/common/type/v1/channel_bit_field_element_pb2.pyi +33 -0
  73. sift/common/type/v1/channel_bit_field_element_pb2_grpc.py +4 -0
  74. sift/common/type/v1/channel_bit_field_element_pb2_grpc.pyi +17 -0
  75. sift/common/type/v1/channel_data_type_pb2.py +29 -0
  76. sift/common/type/v1/channel_data_type_pb2.pyi +50 -0
  77. sift/common/type/v1/channel_data_type_pb2_grpc.py +4 -0
  78. sift/common/type/v1/channel_data_type_pb2_grpc.pyi +17 -0
  79. sift/common/type/v1/channel_enum_type_pb2.py +32 -0
  80. sift/common/type/v1/channel_enum_type_pb2.pyi +29 -0
  81. sift/common/type/v1/channel_enum_type_pb2_grpc.py +4 -0
  82. sift/common/type/v1/channel_enum_type_pb2_grpc.pyi +17 -0
  83. sift/common/type/v1/organization_pb2.py +27 -0
  84. sift/common/type/v1/organization_pb2.pyi +29 -0
  85. sift/common/type/v1/organization_pb2_grpc.py +4 -0
  86. sift/common/type/v1/organization_pb2_grpc.pyi +17 -0
  87. sift/common/type/v1/resource_identifier_pb2.py +46 -0
  88. sift/common/type/v1/resource_identifier_pb2.pyi +145 -0
  89. sift/common/type/v1/resource_identifier_pb2_grpc.py +4 -0
  90. sift/common/type/v1/resource_identifier_pb2_grpc.pyi +17 -0
  91. sift/common/type/v1/user_pb2.py +33 -0
  92. sift/common/type/v1/user_pb2.pyi +36 -0
  93. sift/common/type/v1/user_pb2_grpc.py +4 -0
  94. sift/common/type/v1/user_pb2_grpc.pyi +17 -0
  95. sift/data/__init__.py +0 -0
  96. sift/data/v1/__init__.py +0 -0
  97. sift/data/v1/data_pb2.py +212 -0
  98. sift/data/v1/data_pb2.pyi +745 -0
  99. sift/data/v1/data_pb2_grpc.py +67 -0
  100. sift/data/v1/data_pb2_grpc.pyi +44 -0
  101. sift/ingest/__init__.py +0 -0
  102. sift/ingest/v1/__init__.py +0 -0
  103. sift/ingest/v1/ingest_pb2.py +35 -0
  104. sift/ingest/v1/ingest_pb2.pyi +118 -0
  105. sift/ingest/v1/ingest_pb2_grpc.py +66 -0
  106. sift/ingest/v1/ingest_pb2_grpc.pyi +41 -0
  107. sift/ingestion_configs/__init__.py +0 -0
  108. sift/ingestion_configs/v1/__init__.py +0 -0
  109. sift/ingestion_configs/v1/ingestion_configs_pb2.py +115 -0
  110. sift/ingestion_configs/v1/ingestion_configs_pb2.pyi +332 -0
  111. sift/ingestion_configs/v1/ingestion_configs_pb2_grpc.py +203 -0
  112. sift/ingestion_configs/v1/ingestion_configs_pb2_grpc.pyi +124 -0
  113. sift/notifications/__init__.py +0 -0
  114. sift/notifications/v1/__init__.py +0 -0
  115. sift/notifications/v1/notifications_pb2.py +64 -0
  116. sift/notifications/v1/notifications_pb2.pyi +225 -0
  117. sift/notifications/v1/notifications_pb2_grpc.py +101 -0
  118. sift/notifications/v1/notifications_pb2_grpc.pyi +64 -0
  119. sift/ping/__init__.py +0 -0
  120. sift/ping/v1/__init__.py +0 -0
  121. sift/ping/v1/ping_pb2.py +38 -0
  122. sift/ping/v1/ping_pb2.pyi +36 -0
  123. sift/ping/v1/ping_pb2_grpc.py +66 -0
  124. sift/ping/v1/ping_pb2_grpc.pyi +41 -0
  125. sift/remote_files/__init__.py +0 -0
  126. sift/remote_files/v1/__init__.py +0 -0
  127. sift/remote_files/v1/remote_files_pb2.py +174 -0
  128. sift/remote_files/v1/remote_files_pb2.pyi +472 -0
  129. sift/remote_files/v1/remote_files_pb2_grpc.py +271 -0
  130. sift/remote_files/v1/remote_files_pb2_grpc.pyi +164 -0
  131. sift/report_templates/__init__.py +0 -0
  132. sift/report_templates/v1/__init__.py +0 -0
  133. sift/report_templates/v1/report_templates_pb2.py +146 -0
  134. sift/report_templates/v1/report_templates_pb2.pyi +381 -0
  135. sift/report_templates/v1/report_templates_pb2_grpc.py +169 -0
  136. sift/report_templates/v1/report_templates_pb2_grpc.pyi +104 -0
  137. sift/reports/__init__.py +0 -0
  138. sift/reports/v1/__init__.py +0 -0
  139. sift/reports/v1/reports_pb2.py +193 -0
  140. sift/reports/v1/reports_pb2.pyi +562 -0
  141. sift/reports/v1/reports_pb2_grpc.py +205 -0
  142. sift/reports/v1/reports_pb2_grpc.pyi +136 -0
  143. sift/rule_evaluation/__init__.py +0 -0
  144. sift/rule_evaluation/v1/__init__.py +0 -0
  145. sift/rule_evaluation/v1/rule_evaluation_pb2.py +89 -0
  146. sift/rule_evaluation/v1/rule_evaluation_pb2.pyi +263 -0
  147. sift/rule_evaluation/v1/rule_evaluation_pb2_grpc.py +101 -0
  148. sift/rule_evaluation/v1/rule_evaluation_pb2_grpc.pyi +64 -0
  149. sift/rules/__init__.py +0 -0
  150. sift/rules/v1/__init__.py +0 -0
  151. sift/rules/v1/rules_pb2.py +420 -0
  152. sift/rules/v1/rules_pb2.pyi +1355 -0
  153. sift/rules/v1/rules_pb2_grpc.py +577 -0
  154. sift/rules/v1/rules_pb2_grpc.pyi +351 -0
  155. sift/runs/__init__.py +0 -0
  156. sift/runs/v2/__init__.py +0 -0
  157. sift/runs/v2/runs_pb2.py +150 -0
  158. sift/runs/v2/runs_pb2.pyi +413 -0
  159. sift/runs/v2/runs_pb2_grpc.py +271 -0
  160. sift/runs/v2/runs_pb2_grpc.pyi +164 -0
  161. sift/saved_searches/__init__.py +0 -0
  162. sift/saved_searches/v1/__init__.py +0 -0
  163. sift/saved_searches/v1/saved_searches_pb2.py +144 -0
  164. sift/saved_searches/v1/saved_searches_pb2.pyi +385 -0
  165. sift/saved_searches/v1/saved_searches_pb2_grpc.py +237 -0
  166. sift/saved_searches/v1/saved_searches_pb2_grpc.pyi +144 -0
  167. sift/tags/__init__.py +0 -0
  168. sift/tags/v1/__init__.py +0 -0
  169. sift/tags/v1/tags_pb2.py +49 -0
  170. sift/tags/v1/tags_pb2.pyi +71 -0
  171. sift/tags/v1/tags_pb2_grpc.py +4 -0
  172. sift/tags/v1/tags_pb2_grpc.pyi +17 -0
  173. sift/users/__init__.py +0 -0
  174. sift/users/v2/__init__.py +0 -0
  175. sift/users/v2/users_pb2.py +61 -0
  176. sift/users/v2/users_pb2.pyi +142 -0
  177. sift/users/v2/users_pb2_grpc.py +135 -0
  178. sift/users/v2/users_pb2_grpc.pyi +84 -0
  179. sift/views/__init__.py +0 -0
  180. sift/views/v1/__init__.py +0 -0
  181. sift/views/v1/views_pb2.py +130 -0
  182. sift/views/v1/views_pb2.pyi +466 -0
  183. sift/views/v1/views_pb2_grpc.py +305 -0
  184. sift/views/v1/views_pb2_grpc.pyi +184 -0
  185. sift_grafana/py.typed +0 -0
  186. sift_grafana/sift_query_model.py +64 -0
  187. sift_py/__init__.py +923 -0
  188. sift_py/_internal/__init__.py +5 -0
  189. sift_py/_internal/cel.py +18 -0
  190. sift_py/_internal/channel.py +42 -0
  191. sift_py/_internal/convert/__init__.py +3 -0
  192. sift_py/_internal/convert/json.py +24 -0
  193. sift_py/_internal/convert/protobuf.py +34 -0
  194. sift_py/_internal/convert/timestamp.py +9 -0
  195. sift_py/_internal/test_util/__init__.py +0 -0
  196. sift_py/_internal/test_util/channel.py +136 -0
  197. sift_py/_internal/test_util/fn.py +14 -0
  198. sift_py/_internal/test_util/server_interceptor.py +62 -0
  199. sift_py/_internal/time.py +48 -0
  200. sift_py/_internal/user.py +39 -0
  201. sift_py/data/__init__.py +171 -0
  202. sift_py/data/_channel.py +38 -0
  203. sift_py/data/_deserialize.py +208 -0
  204. sift_py/data/_deserialize_test.py +134 -0
  205. sift_py/data/_service_test.py +276 -0
  206. sift_py/data/_validate.py +10 -0
  207. sift_py/data/error.py +5 -0
  208. sift_py/data/query.py +299 -0
  209. sift_py/data/service.py +497 -0
  210. sift_py/data_import/__init__.py +130 -0
  211. sift_py/data_import/_config.py +167 -0
  212. sift_py/data_import/_config_test.py +166 -0
  213. sift_py/data_import/_csv_test.py +395 -0
  214. sift_py/data_import/_status_test.py +176 -0
  215. sift_py/data_import/_tdms_test.py +238 -0
  216. sift_py/data_import/ch10.py +157 -0
  217. sift_py/data_import/config.py +19 -0
  218. sift_py/data_import/csv.py +259 -0
  219. sift_py/data_import/status.py +113 -0
  220. sift_py/data_import/tdms.py +206 -0
  221. sift_py/data_import/tempfile.py +30 -0
  222. sift_py/data_import/time_format.py +39 -0
  223. sift_py/error.py +11 -0
  224. sift_py/file_attachment/__init__.py +88 -0
  225. sift_py/file_attachment/_internal/__init__.py +0 -0
  226. sift_py/file_attachment/_internal/download.py +13 -0
  227. sift_py/file_attachment/_internal/upload.py +100 -0
  228. sift_py/file_attachment/_service_test.py +161 -0
  229. sift_py/file_attachment/entity.py +30 -0
  230. sift_py/file_attachment/metadata.py +107 -0
  231. sift_py/file_attachment/service.py +142 -0
  232. sift_py/grpc/__init__.py +15 -0
  233. sift_py/grpc/_async_interceptors/__init__.py +0 -0
  234. sift_py/grpc/_async_interceptors/base.py +72 -0
  235. sift_py/grpc/_async_interceptors/metadata.py +36 -0
  236. sift_py/grpc/_interceptors/__init__.py +0 -0
  237. sift_py/grpc/_interceptors/base.py +61 -0
  238. sift_py/grpc/_interceptors/context.py +25 -0
  239. sift_py/grpc/_interceptors/metadata.py +33 -0
  240. sift_py/grpc/_retry.py +70 -0
  241. sift_py/grpc/keepalive.py +34 -0
  242. sift_py/grpc/transport.py +250 -0
  243. sift_py/grpc/transport_test.py +170 -0
  244. sift_py/ingestion/__init__.py +6 -0
  245. sift_py/ingestion/_internal/__init__.py +6 -0
  246. sift_py/ingestion/_internal/channel.py +12 -0
  247. sift_py/ingestion/_internal/error.py +10 -0
  248. sift_py/ingestion/_internal/ingest.py +350 -0
  249. sift_py/ingestion/_internal/ingest_test.py +357 -0
  250. sift_py/ingestion/_internal/ingestion_config.py +130 -0
  251. sift_py/ingestion/_internal/run.py +46 -0
  252. sift_py/ingestion/_service_test.py +478 -0
  253. sift_py/ingestion/buffer.py +189 -0
  254. sift_py/ingestion/channel.py +422 -0
  255. sift_py/ingestion/config/__init__.py +3 -0
  256. sift_py/ingestion/config/telemetry.py +281 -0
  257. sift_py/ingestion/config/telemetry_test.py +405 -0
  258. sift_py/ingestion/config/yaml/__init__.py +0 -0
  259. sift_py/ingestion/config/yaml/error.py +44 -0
  260. sift_py/ingestion/config/yaml/load.py +126 -0
  261. sift_py/ingestion/config/yaml/spec.py +58 -0
  262. sift_py/ingestion/config/yaml/test_load.py +25 -0
  263. sift_py/ingestion/flow.py +73 -0
  264. sift_py/ingestion/manager.py +99 -0
  265. sift_py/ingestion/rule/__init__.py +4 -0
  266. sift_py/ingestion/rule/config.py +11 -0
  267. sift_py/ingestion/service.py +237 -0
  268. sift_py/py.typed +0 -0
  269. sift_py/report_templates/__init__.py +0 -0
  270. sift_py/report_templates/_config_test.py +34 -0
  271. sift_py/report_templates/_service_test.py +94 -0
  272. sift_py/report_templates/config.py +36 -0
  273. sift_py/report_templates/service.py +171 -0
  274. sift_py/rest.py +29 -0
  275. sift_py/rule/__init__.py +0 -0
  276. sift_py/rule/_config_test.py +109 -0
  277. sift_py/rule/_service_test.py +168 -0
  278. sift_py/rule/config.py +229 -0
  279. sift_py/rule/service.py +484 -0
  280. sift_py/yaml/__init__.py +0 -0
  281. sift_py/yaml/_channel_test.py +169 -0
  282. sift_py/yaml/_rule_test.py +207 -0
  283. sift_py/yaml/channel.py +224 -0
  284. sift_py/yaml/report_templates.py +73 -0
  285. sift_py/yaml/rule.py +321 -0
  286. sift_py/yaml/utils.py +15 -0
  287. sift_stack_py-0.3.2.dist-info/LICENSE +7 -0
  288. sift_stack_py-0.3.2.dist-info/METADATA +109 -0
  289. sift_stack_py-0.3.2.dist-info/RECORD +291 -0
  290. sift_stack_py-0.3.2.dist-info/WHEEL +5 -0
  291. sift_stack_py-0.3.2.dist-info/top_level.txt +5 -0
@@ -0,0 +1,433 @@
1
+ """
2
+ @generated by mypy-protobuf. Do not edit manually!
3
+ isort:skip_file
4
+ Copyright 2024 Google LLC
5
+
6
+ Licensed under the Apache License, Version 2.0 (the "License");
7
+ you may not use this file except in compliance with the License.
8
+ You may obtain a copy of the License at
9
+
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ Unless required by applicable law or agreed to in writing, software
13
+ distributed under the License is distributed on an "AS IS" BASIS,
14
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ See the License for the specific language governing permissions and
16
+ limitations under the License.
17
+ """
18
+
19
+ import builtins
20
+ import collections.abc
21
+ import google.protobuf.descriptor
22
+ import google.protobuf.internal.containers
23
+ import google.protobuf.message
24
+ import typing
25
+
26
+ DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
27
+
28
+ @typing.final
29
+ class Http(google.protobuf.message.Message):
30
+ """Defines the HTTP configuration for an API service. It contains a list of
31
+ [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method
32
+ to one or more HTTP REST API methods.
33
+ """
34
+
35
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
36
+
37
+ RULES_FIELD_NUMBER: builtins.int
38
+ FULLY_DECODE_RESERVED_EXPANSION_FIELD_NUMBER: builtins.int
39
+ fully_decode_reserved_expansion: builtins.bool
40
+ """When set to true, URL path parameters will be fully URI-decoded except in
41
+ cases of single segment matches in reserved expansion, where "%2F" will be
42
+ left encoded.
43
+
44
+ The default behavior is to not decode RFC 6570 reserved characters in multi
45
+ segment matches.
46
+ """
47
+ @property
48
+ def rules(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___HttpRule]:
49
+ """A list of HTTP configuration rules that apply to individual API methods.
50
+
51
+ **NOTE:** All service configuration rules follow "last one wins" order.
52
+ """
53
+
54
+ def __init__(
55
+ self,
56
+ *,
57
+ rules: collections.abc.Iterable[global___HttpRule] | None = ...,
58
+ fully_decode_reserved_expansion: builtins.bool = ...,
59
+ ) -> None: ...
60
+ def ClearField(self, field_name: typing.Literal["fully_decode_reserved_expansion", b"fully_decode_reserved_expansion", "rules", b"rules"]) -> None: ...
61
+
62
+ global___Http = Http
63
+
64
+ @typing.final
65
+ class HttpRule(google.protobuf.message.Message):
66
+ """gRPC Transcoding
67
+
68
+ gRPC Transcoding is a feature for mapping between a gRPC method and one or
69
+ more HTTP REST endpoints. It allows developers to build a single API service
70
+ that supports both gRPC APIs and REST APIs. Many systems, including [Google
71
+ APIs](https://github.com/googleapis/googleapis),
72
+ [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC
73
+ Gateway](https://github.com/grpc-ecosystem/grpc-gateway),
74
+ and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature
75
+ and use it for large scale production services.
76
+
77
+ `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies
78
+ how different portions of the gRPC request message are mapped to the URL
79
+ path, URL query parameters, and HTTP request body. It also controls how the
80
+ gRPC response message is mapped to the HTTP response body. `HttpRule` is
81
+ typically specified as an `google.api.http` annotation on the gRPC method.
82
+
83
+ Each mapping specifies a URL path template and an HTTP method. The path
84
+ template may refer to one or more fields in the gRPC request message, as long
85
+ as each field is a non-repeated field with a primitive (non-message) type.
86
+ The path template controls how fields of the request message are mapped to
87
+ the URL path.
88
+
89
+ Example:
90
+
91
+ service Messaging {
92
+ rpc GetMessage(GetMessageRequest) returns (Message) {
93
+ option (google.api.http) = {
94
+ get: "/v1/{name=messages/*}"
95
+ };
96
+ }
97
+ }
98
+ message GetMessageRequest {
99
+ string name = 1; // Mapped to URL path.
100
+ }
101
+ message Message {
102
+ string text = 1; // The resource content.
103
+ }
104
+
105
+ This enables an HTTP REST to gRPC mapping as below:
106
+
107
+ - HTTP: `GET /v1/messages/123456`
108
+ - gRPC: `GetMessage(name: "messages/123456")`
109
+
110
+ Any fields in the request message which are not bound by the path template
111
+ automatically become HTTP query parameters if there is no HTTP request body.
112
+ For example:
113
+
114
+ service Messaging {
115
+ rpc GetMessage(GetMessageRequest) returns (Message) {
116
+ option (google.api.http) = {
117
+ get:"/v1/messages/{message_id}"
118
+ };
119
+ }
120
+ }
121
+ message GetMessageRequest {
122
+ message SubMessage {
123
+ string subfield = 1;
124
+ }
125
+ string message_id = 1; // Mapped to URL path.
126
+ int64 revision = 2; // Mapped to URL query parameter `revision`.
127
+ SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`.
128
+ }
129
+
130
+ This enables a HTTP JSON to RPC mapping as below:
131
+
132
+ - HTTP: `GET /v1/messages/123456?revision=2&sub.subfield=foo`
133
+ - gRPC: `GetMessage(message_id: "123456" revision: 2 sub:
134
+ SubMessage(subfield: "foo"))`
135
+
136
+ Note that fields which are mapped to URL query parameters must have a
137
+ primitive type or a repeated primitive type or a non-repeated message type.
138
+ In the case of a repeated type, the parameter can be repeated in the URL
139
+ as `...?param=A&param=B`. In the case of a message type, each field of the
140
+ message is mapped to a separate parameter, such as
141
+ `...?foo.a=A&foo.b=B&foo.c=C`.
142
+
143
+ For HTTP methods that allow a request body, the `body` field
144
+ specifies the mapping. Consider a REST update method on the
145
+ message resource collection:
146
+
147
+ service Messaging {
148
+ rpc UpdateMessage(UpdateMessageRequest) returns (Message) {
149
+ option (google.api.http) = {
150
+ patch: "/v1/messages/{message_id}"
151
+ body: "message"
152
+ };
153
+ }
154
+ }
155
+ message UpdateMessageRequest {
156
+ string message_id = 1; // mapped to the URL
157
+ Message message = 2; // mapped to the body
158
+ }
159
+
160
+ The following HTTP JSON to RPC mapping is enabled, where the
161
+ representation of the JSON in the request body is determined by
162
+ protos JSON encoding:
163
+
164
+ - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }`
165
+ - gRPC: `UpdateMessage(message_id: "123456" message { text: "Hi!" })`
166
+
167
+ The special name `*` can be used in the body mapping to define that
168
+ every field not bound by the path template should be mapped to the
169
+ request body. This enables the following alternative definition of
170
+ the update method:
171
+
172
+ service Messaging {
173
+ rpc UpdateMessage(Message) returns (Message) {
174
+ option (google.api.http) = {
175
+ patch: "/v1/messages/{message_id}"
176
+ body: "*"
177
+ };
178
+ }
179
+ }
180
+ message Message {
181
+ string message_id = 1;
182
+ string text = 2;
183
+ }
184
+
185
+
186
+ The following HTTP JSON to RPC mapping is enabled:
187
+
188
+ - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }`
189
+ - gRPC: `UpdateMessage(message_id: "123456" text: "Hi!")`
190
+
191
+ Note that when using `*` in the body mapping, it is not possible to
192
+ have HTTP parameters, as all fields not bound by the path end in
193
+ the body. This makes this option more rarely used in practice when
194
+ defining REST APIs. The common usage of `*` is in custom methods
195
+ which don't use the URL at all for transferring data.
196
+
197
+ It is possible to define multiple HTTP methods for one RPC by using
198
+ the `additional_bindings` option. Example:
199
+
200
+ service Messaging {
201
+ rpc GetMessage(GetMessageRequest) returns (Message) {
202
+ option (google.api.http) = {
203
+ get: "/v1/messages/{message_id}"
204
+ additional_bindings {
205
+ get: "/v1/users/{user_id}/messages/{message_id}"
206
+ }
207
+ };
208
+ }
209
+ }
210
+ message GetMessageRequest {
211
+ string message_id = 1;
212
+ string user_id = 2;
213
+ }
214
+
215
+ This enables the following two alternative HTTP JSON to RPC mappings:
216
+
217
+ - HTTP: `GET /v1/messages/123456`
218
+ - gRPC: `GetMessage(message_id: "123456")`
219
+
220
+ - HTTP: `GET /v1/users/me/messages/123456`
221
+ - gRPC: `GetMessage(user_id: "me" message_id: "123456")`
222
+
223
+ Rules for HTTP mapping
224
+
225
+ 1. Leaf request fields (recursive expansion nested messages in the request
226
+ message) are classified into three categories:
227
+ - Fields referred by the path template. They are passed via the URL path.
228
+ - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They
229
+ are passed via the HTTP
230
+ request body.
231
+ - All other fields are passed via the URL query parameters, and the
232
+ parameter name is the field path in the request message. A repeated
233
+ field can be represented as multiple query parameters under the same
234
+ name.
235
+ 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL
236
+ query parameter, all fields
237
+ are passed via URL path and HTTP request body.
238
+ 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP
239
+ request body, all
240
+ fields are passed via URL path and URL query parameters.
241
+
242
+ Path template syntax
243
+
244
+ Template = "/" Segments [ Verb ] ;
245
+ Segments = Segment { "/" Segment } ;
246
+ Segment = "*" | "**" | LITERAL | Variable ;
247
+ Variable = "{" FieldPath [ "=" Segments ] "}" ;
248
+ FieldPath = IDENT { "." IDENT } ;
249
+ Verb = ":" LITERAL ;
250
+
251
+ The syntax `*` matches a single URL path segment. The syntax `**` matches
252
+ zero or more URL path segments, which must be the last part of the URL path
253
+ except the `Verb`.
254
+
255
+ The syntax `Variable` matches part of the URL path as specified by its
256
+ template. A variable template must not contain other variables. If a variable
257
+ matches a single path segment, its template may be omitted, e.g. `{var}`
258
+ is equivalent to `{var=*}`.
259
+
260
+ The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL`
261
+ contains any reserved character, such characters should be percent-encoded
262
+ before the matching.
263
+
264
+ If a variable contains exactly one path segment, such as `"{var}"` or
265
+ `"{var=*}"`, when such a variable is expanded into a URL path on the client
266
+ side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The
267
+ server side does the reverse decoding. Such variables show up in the
268
+ [Discovery
269
+ Document](https://developers.google.com/discovery/v1/reference/apis) as
270
+ `{var}`.
271
+
272
+ If a variable contains multiple path segments, such as `"{var=foo/*}"`
273
+ or `"{var=**}"`, when such a variable is expanded into a URL path on the
274
+ client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded.
275
+ The server side does the reverse decoding, except "%2F" and "%2f" are left
276
+ unchanged. Such variables show up in the
277
+ [Discovery
278
+ Document](https://developers.google.com/discovery/v1/reference/apis) as
279
+ `{+var}`.
280
+
281
+ Using gRPC API Service Configuration
282
+
283
+ gRPC API Service Configuration (service config) is a configuration language
284
+ for configuring a gRPC service to become a user-facing product. The
285
+ service config is simply the YAML representation of the `google.api.Service`
286
+ proto message.
287
+
288
+ As an alternative to annotating your proto file, you can configure gRPC
289
+ transcoding in your service config YAML files. You do this by specifying a
290
+ `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same
291
+ effect as the proto annotation. This can be particularly useful if you
292
+ have a proto that is reused in multiple services. Note that any transcoding
293
+ specified in the service config will override any matching transcoding
294
+ configuration in the proto.
295
+
296
+ The following example selects a gRPC method and applies an `HttpRule` to it:
297
+
298
+ http:
299
+ rules:
300
+ - selector: example.v1.Messaging.GetMessage
301
+ get: /v1/messages/{message_id}/{sub.subfield}
302
+
303
+ Special notes
304
+
305
+ When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the
306
+ proto to JSON conversion must follow the [proto3
307
+ specification](https://developers.google.com/protocol-buffers/docs/proto3#json).
308
+
309
+ While the single segment variable follows the semantics of
310
+ [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String
311
+ Expansion, the multi segment variable **does not** follow RFC 6570 Section
312
+ 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion
313
+ does not expand special characters like `?` and `#`, which would lead
314
+ to invalid URLs. As the result, gRPC Transcoding uses a custom encoding
315
+ for multi segment variables.
316
+
317
+ The path variables **must not** refer to any repeated or mapped field,
318
+ because client libraries are not capable of handling such variable expansion.
319
+
320
+ The path variables **must not** capture the leading "/" character. The reason
321
+ is that the most common use case "{var}" does not capture the leading "/"
322
+ character. For consistency, all path variables must share the same behavior.
323
+
324
+ Repeated message fields must not be mapped to URL query parameters, because
325
+ no client library can support such complicated mapping.
326
+
327
+ If an API needs to use a JSON array for request or response body, it can map
328
+ the request or response body to a repeated field. However, some gRPC
329
+ Transcoding implementations may not support this feature.
330
+ """
331
+
332
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
333
+
334
+ SELECTOR_FIELD_NUMBER: builtins.int
335
+ GET_FIELD_NUMBER: builtins.int
336
+ PUT_FIELD_NUMBER: builtins.int
337
+ POST_FIELD_NUMBER: builtins.int
338
+ DELETE_FIELD_NUMBER: builtins.int
339
+ PATCH_FIELD_NUMBER: builtins.int
340
+ CUSTOM_FIELD_NUMBER: builtins.int
341
+ BODY_FIELD_NUMBER: builtins.int
342
+ RESPONSE_BODY_FIELD_NUMBER: builtins.int
343
+ ADDITIONAL_BINDINGS_FIELD_NUMBER: builtins.int
344
+ selector: builtins.str
345
+ """Selects a method to which this rule applies.
346
+
347
+ Refer to [selector][google.api.DocumentationRule.selector] for syntax
348
+ details.
349
+ """
350
+ get: builtins.str
351
+ """Maps to HTTP GET. Used for listing and getting information about
352
+ resources.
353
+ """
354
+ put: builtins.str
355
+ """Maps to HTTP PUT. Used for replacing a resource."""
356
+ post: builtins.str
357
+ """Maps to HTTP POST. Used for creating a resource or performing an action."""
358
+ delete: builtins.str
359
+ """Maps to HTTP DELETE. Used for deleting a resource."""
360
+ patch: builtins.str
361
+ """Maps to HTTP PATCH. Used for updating a resource."""
362
+ body: builtins.str
363
+ """The name of the request field whose value is mapped to the HTTP request
364
+ body, or `*` for mapping all request fields not captured by the path
365
+ pattern to the HTTP body, or omitted for not having any HTTP request body.
366
+
367
+ NOTE: the referred field must be present at the top-level of the request
368
+ message type.
369
+ """
370
+ response_body: builtins.str
371
+ """Optional. The name of the response field whose value is mapped to the HTTP
372
+ response body. When omitted, the entire response message will be used
373
+ as the HTTP response body.
374
+
375
+ NOTE: The referred field must be present at the top-level of the response
376
+ message type.
377
+ """
378
+ @property
379
+ def custom(self) -> global___CustomHttpPattern:
380
+ """The custom pattern is used for specifying an HTTP method that is not
381
+ included in the `pattern` field, such as HEAD, or "*" to leave the
382
+ HTTP method unspecified for this rule. The wild-card rule is useful
383
+ for services that provide content to Web (HTML) clients.
384
+ """
385
+
386
+ @property
387
+ def additional_bindings(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___HttpRule]:
388
+ """Additional HTTP bindings for the selector. Nested bindings must
389
+ not contain an `additional_bindings` field themselves (that is,
390
+ the nesting may only be one level deep).
391
+ """
392
+
393
+ def __init__(
394
+ self,
395
+ *,
396
+ selector: builtins.str = ...,
397
+ get: builtins.str = ...,
398
+ put: builtins.str = ...,
399
+ post: builtins.str = ...,
400
+ delete: builtins.str = ...,
401
+ patch: builtins.str = ...,
402
+ custom: global___CustomHttpPattern | None = ...,
403
+ body: builtins.str = ...,
404
+ response_body: builtins.str = ...,
405
+ additional_bindings: collections.abc.Iterable[global___HttpRule] | None = ...,
406
+ ) -> None: ...
407
+ def HasField(self, field_name: typing.Literal["custom", b"custom", "delete", b"delete", "get", b"get", "patch", b"patch", "pattern", b"pattern", "post", b"post", "put", b"put"]) -> builtins.bool: ...
408
+ def ClearField(self, field_name: typing.Literal["additional_bindings", b"additional_bindings", "body", b"body", "custom", b"custom", "delete", b"delete", "get", b"get", "patch", b"patch", "pattern", b"pattern", "post", b"post", "put", b"put", "response_body", b"response_body", "selector", b"selector"]) -> None: ...
409
+ def WhichOneof(self, oneof_group: typing.Literal["pattern", b"pattern"]) -> typing.Literal["get", "put", "post", "delete", "patch", "custom"] | None: ...
410
+
411
+ global___HttpRule = HttpRule
412
+
413
+ @typing.final
414
+ class CustomHttpPattern(google.protobuf.message.Message):
415
+ """A custom pattern is used for defining custom HTTP verb."""
416
+
417
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
418
+
419
+ KIND_FIELD_NUMBER: builtins.int
420
+ PATH_FIELD_NUMBER: builtins.int
421
+ kind: builtins.str
422
+ """The name of this custom HTTP verb."""
423
+ path: builtins.str
424
+ """The path matched by this custom verb."""
425
+ def __init__(
426
+ self,
427
+ *,
428
+ kind: builtins.str = ...,
429
+ path: builtins.str = ...,
430
+ ) -> None: ...
431
+ def ClearField(self, field_name: typing.Literal["kind", b"kind", "path", b"path"]) -> None: ...
432
+
433
+ global___CustomHttpPattern = CustomHttpPattern
@@ -0,0 +1,4 @@
1
+ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
2
+ """Client and server classes corresponding to protobuf-defined services."""
3
+ import grpc
4
+
@@ -0,0 +1,30 @@
1
+ """
2
+ @generated by mypy-protobuf. Do not edit manually!
3
+ isort:skip_file
4
+ Copyright 2024 Google LLC
5
+
6
+ Licensed under the Apache License, Version 2.0 (the "License");
7
+ you may not use this file except in compliance with the License.
8
+ You may obtain a copy of the License at
9
+
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ Unless required by applicable law or agreed to in writing, software
13
+ distributed under the License is distributed on an "AS IS" BASIS,
14
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ See the License for the specific language governing permissions and
16
+ limitations under the License.
17
+ """
18
+
19
+ import abc
20
+ import collections.abc
21
+ import grpc
22
+ import grpc.aio
23
+ import typing
24
+
25
+ _T = typing.TypeVar("_T")
26
+
27
+ class _MaybeAsyncIterator(collections.abc.AsyncIterator[_T], collections.abc.Iterator[_T], metaclass=abc.ABCMeta): ...
28
+
29
+ class _ServicerContext(grpc.ServicerContext, grpc.aio.ServicerContext): # type: ignore[misc, type-arg]
30
+ ...
File without changes
File without changes
@@ -0,0 +1,27 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # source: protoc-gen-openapiv2/options/annotations.proto
4
+ # Protobuf Python Version: 5.26.1
5
+ """Generated protocol buffer code."""
6
+ from google.protobuf import descriptor as _descriptor
7
+ from google.protobuf import descriptor_pool as _descriptor_pool
8
+ from google.protobuf import symbol_database as _symbol_database
9
+ from google.protobuf.internal import builder as _builder
10
+ # @@protoc_insertion_point(imports)
11
+
12
+ _sym_db = _symbol_database.Default()
13
+
14
+
15
+ from google.protobuf import descriptor_pb2 as google_dot_protobuf_dot_descriptor__pb2
16
+ from protoc_gen_openapiv2.options import openapiv2_pb2 as protoc__gen__openapiv2_dot_options_dot_openapiv2__pb2
17
+
18
+
19
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n.protoc-gen-openapiv2/options/annotations.proto\x12)grpc.gateway.protoc_gen_openapiv2.options\x1a google/protobuf/descriptor.proto\x1a,protoc-gen-openapiv2/options/openapiv2.proto:~\n\x11openapiv2_swagger\x12\x1c.google.protobuf.FileOptions\x18\x92\x08 \x01(\x0b\x32\x32.grpc.gateway.protoc_gen_openapiv2.options.SwaggerR\x10openapiv2Swagger:\x86\x01\n\x13openapiv2_operation\x12\x1e.google.protobuf.MethodOptions\x18\x92\x08 \x01(\x0b\x32\x34.grpc.gateway.protoc_gen_openapiv2.options.OperationR\x12openapiv2Operation:~\n\x10openapiv2_schema\x12\x1f.google.protobuf.MessageOptions\x18\x92\x08 \x01(\x0b\x32\x31.grpc.gateway.protoc_gen_openapiv2.options.SchemaR\x0fopenapiv2Schema:u\n\ropenapiv2_tag\x12\x1f.google.protobuf.ServiceOptions\x18\x92\x08 \x01(\x0b\x32..grpc.gateway.protoc_gen_openapiv2.options.TagR\x0copenapiv2Tag:~\n\x0fopenapiv2_field\x12\x1d.google.protobuf.FieldOptions\x18\x92\x08 \x01(\x0b\x32\x35.grpc.gateway.protoc_gen_openapiv2.options.JSONSchemaR\x0eopenapiv2FieldB\xc9\x02\n-com.grpc.gateway.protoc_gen_openapiv2.optionsB\x10\x41nnotationsProtoP\x01ZFgithub.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options\xa2\x02\x04GGPO\xaa\x02\'Grpc.Gateway.ProtocGenOpenapiv2.Options\xca\x02\'Grpc\\Gateway\\ProtocGenOpenapiv2\\Options\xe2\x02\x33Grpc\\Gateway\\ProtocGenOpenapiv2\\Options\\GPBMetadata\xea\x02*Grpc::Gateway::ProtocGenOpenapiv2::Optionsb\x06proto3')
20
+
21
+ _globals = globals()
22
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
23
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'protoc_gen_openapiv2.options.annotations_pb2', _globals)
24
+ if not _descriptor._USE_C_DESCRIPTORS:
25
+ _globals['DESCRIPTOR']._loaded_options = None
26
+ _globals['DESCRIPTOR']._serialized_options = b'\n-com.grpc.gateway.protoc_gen_openapiv2.optionsB\020AnnotationsProtoP\001ZFgithub.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options\242\002\004GGPO\252\002\'Grpc.Gateway.ProtocGenOpenapiv2.Options\312\002\'Grpc\\Gateway\\ProtocGenOpenapiv2\\Options\342\0023Grpc\\Gateway\\ProtocGenOpenapiv2\\Options\\GPBMetadata\352\002*Grpc::Gateway::ProtocGenOpenapiv2::Options'
27
+ # @@protoc_insertion_point(module_scope)
@@ -0,0 +1,48 @@
1
+ """
2
+ @generated by mypy-protobuf. Do not edit manually!
3
+ isort:skip_file
4
+ """
5
+
6
+ import builtins
7
+ import google.protobuf.descriptor
8
+ import google.protobuf.descriptor_pb2
9
+ import google.protobuf.internal.extension_dict
10
+ import protoc_gen_openapiv2.options.openapiv2_pb2
11
+
12
+ DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
13
+
14
+ OPENAPIV2_SWAGGER_FIELD_NUMBER: builtins.int
15
+ OPENAPIV2_OPERATION_FIELD_NUMBER: builtins.int
16
+ OPENAPIV2_SCHEMA_FIELD_NUMBER: builtins.int
17
+ OPENAPIV2_TAG_FIELD_NUMBER: builtins.int
18
+ OPENAPIV2_FIELD_FIELD_NUMBER: builtins.int
19
+ openapiv2_swagger: google.protobuf.internal.extension_dict._ExtensionFieldDescriptor[google.protobuf.descriptor_pb2.FileOptions, protoc_gen_openapiv2.options.openapiv2_pb2.Swagger]
20
+ """ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project.
21
+
22
+ All IDs are the same, as assigned. It is okay that they are the same, as they extend
23
+ different descriptor messages.
24
+ """
25
+ openapiv2_operation: google.protobuf.internal.extension_dict._ExtensionFieldDescriptor[google.protobuf.descriptor_pb2.MethodOptions, protoc_gen_openapiv2.options.openapiv2_pb2.Operation]
26
+ """ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project.
27
+
28
+ All IDs are the same, as assigned. It is okay that they are the same, as they extend
29
+ different descriptor messages.
30
+ """
31
+ openapiv2_schema: google.protobuf.internal.extension_dict._ExtensionFieldDescriptor[google.protobuf.descriptor_pb2.MessageOptions, protoc_gen_openapiv2.options.openapiv2_pb2.Schema]
32
+ """ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project.
33
+
34
+ All IDs are the same, as assigned. It is okay that they are the same, as they extend
35
+ different descriptor messages.
36
+ """
37
+ openapiv2_tag: google.protobuf.internal.extension_dict._ExtensionFieldDescriptor[google.protobuf.descriptor_pb2.ServiceOptions, protoc_gen_openapiv2.options.openapiv2_pb2.Tag]
38
+ """ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project.
39
+
40
+ All IDs are the same, as assigned. It is okay that they are the same, as they extend
41
+ different descriptor messages.
42
+ """
43
+ openapiv2_field: google.protobuf.internal.extension_dict._ExtensionFieldDescriptor[google.protobuf.descriptor_pb2.FieldOptions, protoc_gen_openapiv2.options.openapiv2_pb2.JSONSchema]
44
+ """ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project.
45
+
46
+ All IDs are the same, as assigned. It is okay that they are the same, as they extend
47
+ different descriptor messages.
48
+ """
@@ -0,0 +1,4 @@
1
+ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
2
+ """Client and server classes corresponding to protobuf-defined services."""
3
+ import grpc
4
+
@@ -0,0 +1,17 @@
1
+ """
2
+ @generated by mypy-protobuf. Do not edit manually!
3
+ isort:skip_file
4
+ """
5
+
6
+ import abc
7
+ import collections.abc
8
+ import grpc
9
+ import grpc.aio
10
+ import typing
11
+
12
+ _T = typing.TypeVar("_T")
13
+
14
+ class _MaybeAsyncIterator(collections.abc.AsyncIterator[_T], collections.abc.Iterator[_T], metaclass=abc.ABCMeta): ...
15
+
16
+ class _ServicerContext(grpc.ServicerContext, grpc.aio.ServicerContext): # type: ignore[misc, type-arg]
17
+ ...