protobufjs 4.1.2 → 5.0.2

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 (188) hide show
  1. package/.travis.yml +3 -1
  2. package/README.md +147 -25
  3. package/bin/pbjs +2 -2
  4. package/bower.json +3 -3
  5. package/cli/pbjs/targets/amd.js +1 -1
  6. package/cli/pbjs/targets/json.js +9 -1
  7. package/cli/pbjs/targets/proto.js +48 -24
  8. package/cli/pbjs/util.js +1 -1
  9. package/cli/pbjs.js +9 -2
  10. package/dist/README.md +10 -10
  11. package/dist/{ProtoBuf-light.js → protobuf-light.js} +207 -152
  12. package/dist/protobuf-light.min.js +94 -0
  13. package/dist/protobuf-light.min.js.gz +0 -0
  14. package/dist/protobuf-light.min.map +8 -0
  15. package/dist/{ProtoBuf.js → protobuf.js} +265 -175
  16. package/dist/protobuf.min.js +116 -0
  17. package/dist/protobuf.min.js.gz +0 -0
  18. package/dist/protobuf.min.map +8 -0
  19. package/docs/ProtoBuf.Builder.Message.html +1473 -967
  20. package/docs/ProtoBuf.Builder.Service.html +266 -197
  21. package/docs/ProtoBuf.Builder.html +758 -542
  22. package/docs/ProtoBuf.DotProto.Parser.html +223 -161
  23. package/docs/ProtoBuf.DotProto.Tokenizer.html +344 -248
  24. package/docs/ProtoBuf.DotProto.html +20 -12
  25. package/docs/ProtoBuf.Element.html +554 -554
  26. package/docs/ProtoBuf.Map.html +158 -123
  27. package/docs/ProtoBuf.Reflect.Element.html +286 -143
  28. package/docs/ProtoBuf.Reflect.Enum.Value.html +329 -228
  29. package/docs/ProtoBuf.Reflect.Enum.html +757 -537
  30. package/docs/ProtoBuf.Reflect.Extension.html +73 -56
  31. package/docs/ProtoBuf.Reflect.Message.ExtensionField.html +1013 -740
  32. package/docs/ProtoBuf.Reflect.Message.Field.html +926 -649
  33. package/docs/ProtoBuf.Reflect.Message.OneOf.html +327 -245
  34. package/docs/ProtoBuf.Reflect.Message.html +919 -652
  35. package/docs/ProtoBuf.Reflect.Namespace.html +648 -447
  36. package/docs/ProtoBuf.Reflect.Service.Method.html +363 -251
  37. package/docs/ProtoBuf.Reflect.Service.RPCMethod.html +545 -397
  38. package/docs/ProtoBuf.Reflect.Service.html +721 -511
  39. package/docs/ProtoBuf.Reflect.T.html +268 -197
  40. package/docs/ProtoBuf.Reflect.html +20 -12
  41. package/docs/ProtoBuf.Util.html +169 -118
  42. package/docs/ProtoBuf.html +840 -628
  43. package/docs/ProtoBuf.js.html +271 -180
  44. package/docs/fonts/OpenSans-Bold-webfont.eot +0 -0
  45. package/docs/fonts/OpenSans-Bold-webfont.svg +1830 -0
  46. package/docs/fonts/OpenSans-Bold-webfont.woff +0 -0
  47. package/docs/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
  48. package/docs/fonts/OpenSans-BoldItalic-webfont.svg +1830 -0
  49. package/docs/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
  50. package/docs/fonts/OpenSans-Italic-webfont.eot +0 -0
  51. package/docs/fonts/OpenSans-Italic-webfont.svg +1830 -0
  52. package/docs/fonts/OpenSans-Italic-webfont.woff +0 -0
  53. package/docs/fonts/OpenSans-Light-webfont.eot +0 -0
  54. package/docs/fonts/OpenSans-Light-webfont.svg +1831 -0
  55. package/docs/fonts/OpenSans-Light-webfont.woff +0 -0
  56. package/docs/fonts/OpenSans-LightItalic-webfont.eot +0 -0
  57. package/docs/fonts/OpenSans-LightItalic-webfont.svg +1835 -0
  58. package/docs/fonts/OpenSans-LightItalic-webfont.woff +0 -0
  59. package/docs/fonts/OpenSans-Regular-webfont.eot +0 -0
  60. package/docs/fonts/OpenSans-Regular-webfont.svg +1831 -0
  61. package/docs/fonts/OpenSans-Regular-webfont.woff +0 -0
  62. package/docs/index.html +7 -5
  63. package/docs/styles/jsdoc-default.css +95 -75
  64. package/docs/styles/prettify-tomorrow.css +1 -1
  65. package/donate.png +0 -0
  66. package/examples/protoify/json.js +123 -123
  67. package/examples/protoify/json.json +123 -123
  68. package/examples/websocket/server.js +4 -4
  69. package/externs/{ProtoBuf.js → protobuf.js} +933 -922
  70. package/index.js +1 -18
  71. package/jsdoc.json +1 -1
  72. package/package.json +11 -11
  73. package/protobuf.png +0 -0
  74. package/scripts/build.js +53 -58
  75. package/src/ProtoBuf/Builder/Message.js +18 -9
  76. package/src/ProtoBuf/Builder/Service.js +3 -0
  77. package/src/ProtoBuf/Builder.js +34 -10
  78. package/src/ProtoBuf/DotProto/Parser.js +58 -23
  79. package/src/ProtoBuf/Reflect/Element.js +17 -4
  80. package/src/ProtoBuf/Reflect/Message/Field.js +6 -5
  81. package/src/ProtoBuf/Reflect/Message.js +9 -4
  82. package/src/ProtoBuf/Util.js +116 -116
  83. package/src/bower.json +2 -2
  84. package/src/google/protobuf/descriptor.json +55 -15
  85. package/src/{ProtoBuf.js → protobuf.js} +0 -0
  86. package/src/wrap.js +4 -4
  87. package/tests/bench.txt +373 -373
  88. package/tests/complex.json +8 -1
  89. package/tests/custom-options.json +169 -169
  90. package/tests/extend.json +71 -71
  91. package/tests/imports-weak.proto +7 -0
  92. package/tests/imports.json +83 -83
  93. package/tests/nodeunit-browser/nodeunit.css +70 -70
  94. package/tests/nodeunit-browser/nodeunit.js +2108 -2108
  95. package/tests/options.json +32 -32
  96. package/tests/proto2js/Bar.json +46 -46
  97. package/tests/suite.js +107 -82
  98. package/ProtoBuf.png +0 -0
  99. package/dist/ProtoBuf-light.min.js +0 -87
  100. package/dist/ProtoBuf-light.min.js.gz +0 -0
  101. package/dist/ProtoBuf-light.min.map +0 -8
  102. package/dist/ProtoBuf.min.js +0 -108
  103. package/dist/ProtoBuf.min.js.gz +0 -0
  104. package/dist/ProtoBuf.min.map +0 -8
  105. package/externs/ByteBuffer.js +0 -767
  106. package/externs/Long.js +0 -328
  107. package/sandbox/gapi/googleapis/google/api/annotations.proto +0 -29
  108. package/sandbox/gapi/googleapis/google/api/http.proto +0 -245
  109. package/sandbox/gapi/googleapis/google/datastore/v1beta3/datastore.proto +0 -281
  110. package/sandbox/gapi/googleapis/google/datastore/v1beta3/entity.proto +0 -189
  111. package/sandbox/gapi/googleapis/google/datastore/v1beta3/query.proto +0 -281
  112. package/sandbox/gapi/googleapis/google/longrunning/operations.proto +0 -144
  113. package/sandbox/gapi/googleapis/google/protobuf/any.proto +0 -98
  114. package/sandbox/gapi/googleapis/google/protobuf/any_test.proto +0 -41
  115. package/sandbox/gapi/googleapis/google/protobuf/api.proto +0 -201
  116. package/sandbox/gapi/googleapis/google/protobuf/descriptor.proto +0 -773
  117. package/sandbox/gapi/googleapis/google/protobuf/duration.proto +0 -95
  118. package/sandbox/gapi/googleapis/google/protobuf/empty.proto +0 -50
  119. package/sandbox/gapi/googleapis/google/protobuf/field_mask.proto +0 -167
  120. package/sandbox/gapi/googleapis/google/protobuf/map_lite_unittest.proto +0 -130
  121. package/sandbox/gapi/googleapis/google/protobuf/map_proto2_unittest.proto +0 -60
  122. package/sandbox/gapi/googleapis/google/protobuf/map_unittest.proto +0 -129
  123. package/sandbox/gapi/googleapis/google/protobuf/map_unittest_proto3.proto +0 -120
  124. package/sandbox/gapi/googleapis/google/protobuf/source_context.proto +0 -47
  125. package/sandbox/gapi/googleapis/google/protobuf/struct.proto +0 -94
  126. package/sandbox/gapi/googleapis/google/protobuf/timestamp.proto +0 -107
  127. package/sandbox/gapi/googleapis/google/protobuf/type.proto +0 -176
  128. package/sandbox/gapi/googleapis/google/protobuf/unittest.proto +0 -878
  129. package/sandbox/gapi/googleapis/google/protobuf/unittest_arena.proto +0 -46
  130. package/sandbox/gapi/googleapis/google/protobuf/unittest_custom_options.proto +0 -394
  131. package/sandbox/gapi/googleapis/google/protobuf/unittest_drop_unknown_fields.proto +0 -58
  132. package/sandbox/gapi/googleapis/google/protobuf/unittest_embed_optimize_for.proto +0 -51
  133. package/sandbox/gapi/googleapis/google/protobuf/unittest_empty.proto +0 -38
  134. package/sandbox/gapi/googleapis/google/protobuf/unittest_enormous_descriptor.proto +0 -1048
  135. package/sandbox/gapi/googleapis/google/protobuf/unittest_import.proto +0 -66
  136. package/sandbox/gapi/googleapis/google/protobuf/unittest_import_lite.proto +0 -52
  137. package/sandbox/gapi/googleapis/google/protobuf/unittest_import_proto3.proto +0 -68
  138. package/sandbox/gapi/googleapis/google/protobuf/unittest_import_public.proto +0 -41
  139. package/sandbox/gapi/googleapis/google/protobuf/unittest_import_public_lite.proto +0 -43
  140. package/sandbox/gapi/googleapis/google/protobuf/unittest_import_public_proto3.proto +0 -42
  141. package/sandbox/gapi/googleapis/google/protobuf/unittest_lite.proto +0 -385
  142. package/sandbox/gapi/googleapis/google/protobuf/unittest_lite_imports_nonlite.proto +0 -44
  143. package/sandbox/gapi/googleapis/google/protobuf/unittest_mset.proto +0 -82
  144. package/sandbox/gapi/googleapis/google/protobuf/unittest_mset_wire_format.proto +0 -52
  145. package/sandbox/gapi/googleapis/google/protobuf/unittest_no_arena.proto +0 -202
  146. package/sandbox/gapi/googleapis/google/protobuf/unittest_no_arena_import.proto +0 -37
  147. package/sandbox/gapi/googleapis/google/protobuf/unittest_no_arena_lite.proto +0 -42
  148. package/sandbox/gapi/googleapis/google/protobuf/unittest_no_field_presence.proto +0 -138
  149. package/sandbox/gapi/googleapis/google/protobuf/unittest_no_generic_services.proto +0 -54
  150. package/sandbox/gapi/googleapis/google/protobuf/unittest_optimize_for.proto +0 -67
  151. package/sandbox/gapi/googleapis/google/protobuf/unittest_preserve_unknown_enum.proto +0 -71
  152. package/sandbox/gapi/googleapis/google/protobuf/unittest_preserve_unknown_enum2.proto +0 -50
  153. package/sandbox/gapi/googleapis/google/protobuf/unittest_proto3.proto +0 -388
  154. package/sandbox/gapi/googleapis/google/protobuf/unittest_proto3_arena.proto +0 -206
  155. package/sandbox/gapi/googleapis/google/protobuf/unittest_well_known_types.proto +0 -112
  156. package/sandbox/gapi/googleapis/google/protobuf/unknown_enum_test.proto +0 -62
  157. package/sandbox/gapi/googleapis/google/protobuf/wrappers.proto +0 -117
  158. package/sandbox/gapi/googleapis/google/rpc/code.proto +0 -190
  159. package/sandbox/gapi/googleapis/google/rpc/error_details.proto +0 -157
  160. package/sandbox/gapi/googleapis/google/rpc/status.proto +0 -90
  161. package/sandbox/gapi/googleapis/google/type/color.proto +0 -163
  162. package/sandbox/gapi/googleapis/google/type/date.proto +0 -43
  163. package/sandbox/gapi/googleapis/google/type/dayofweek.proto +0 -50
  164. package/sandbox/gapi/googleapis/google/type/latlng.proto +0 -36
  165. package/sandbox/gapi/googleapis/google/type/money.proto +0 -40
  166. package/sandbox/gapi/googleapis/google/type/timeofday.proto +0 -42
  167. package/sandbox/gapi/test.js +0 -17
  168. package/sandbox/gapi/test.proto +0 -12
  169. package/sandbox/issue146/MyOptions.proto +0 -28
  170. package/sandbox/issue146/Sample.proto +0 -21
  171. package/sandbox/issue146/main.js +0 -3
  172. package/sandbox/issue147/enum.proto +0 -8
  173. package/sandbox/issue147/main.js +0 -3
  174. package/sandbox/issue182/commands.proto +0 -10
  175. package/sandbox/issue182/execute.js +0 -22
  176. package/sandbox/issue182/session_commands.proto +0 -14
  177. package/sandbox/issue289/A.proto +0 -8
  178. package/sandbox/issue289/B.proto +0 -8
  179. package/sandbox/issue289/common.proto +0 -5
  180. package/sandbox/issue289/main.js +0 -7
  181. package/sandbox/issue300/IAuth.proto +0 -14
  182. package/sandbox/issue300/Request.proto +0 -14
  183. package/sandbox/issue300/main.js +0 -26
  184. package/sandbox/issue42/innerextend.proto +0 -18
  185. package/sandbox/issue42/main.js +0 -8
  186. package/sandbox/issue42/outerextend.proto +0 -17
  187. package/tests/gtfs-realtime.proto +0 -552
  188. package/webpack.config.js +0 -9
@@ -1,281 +0,0 @@
1
- // Copyright (c) 2015, Google Inc.
2
- //
3
- // Licensed under the Apache License, Version 2.0 (the "License");
4
- // you may not use this file except in compliance with the License.
5
- // You may obtain a copy of the License at
6
- //
7
- // http://www.apache.org/licenses/LICENSE-2.0
8
- //
9
- // Unless required by applicable law or agreed to in writing, software
10
- // distributed under the License is distributed on an "AS IS" BASIS,
11
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- // See the License for the specific language governing permissions and
13
- // limitations under the License.
14
-
15
- syntax = "proto3";
16
-
17
- package google.datastore.v1beta3;
18
-
19
- import "google/api/annotations.proto";
20
- import "google/datastore/v1beta3/entity.proto";
21
- import "google/protobuf/wrappers.proto";
22
-
23
- option java_multiple_files = true;
24
- option java_outer_classname = "QueryProto";
25
- option java_package = "com.google.datastore.v1beta3";
26
-
27
-
28
- // The result of fetching an entity from the datastore.
29
- message EntityResult {
30
- // Specifies what data the 'entity' field contains.
31
- // A `ResultType` is either implied (for example, in `LookupResponse.found`
32
- // from `datastore.proto`, it is always `FULL`) or specified by context (for
33
- // example, in message `QueryResultBatch`, field `entity_result_type`
34
- // specifies a `ResultType` for all the values in field `entity_results`).
35
- enum ResultType {
36
- // Unspecified.
37
- RESULT_TYPE_UNSPECIFIED = 0;
38
-
39
- // The entire entity.
40
- FULL = 1;
41
-
42
- // A projected subset of properties. The entity may have no key. A property
43
- // value may have meaning 18.
44
- PROJECTION = 2;
45
-
46
- // Only the key.
47
- KEY_ONLY = 3;
48
- }
49
-
50
- // The resulting entity.
51
- Entity entity = 1;
52
-
53
- // A cursor that points to the position after the result entity.
54
- // Set only when the `EntityResult` is part of a `QueryResultBatch` message.
55
- bytes cursor = 3;
56
- }
57
-
58
- // A query.
59
- message Query {
60
- // The projection to return. Defaults to returning all properties.
61
- repeated Projection projection = 2;
62
-
63
- // The kinds to query (if empty, returns entities of all kinds).
64
- // Currently at most 1 kind may be specified.
65
- repeated KindExpression kind = 3;
66
-
67
- // The filter to apply.
68
- Filter filter = 4;
69
-
70
- // The order to apply to the query results (if empty, order is unspecified).
71
- repeated PropertyOrder order = 5;
72
-
73
- // The properties to make distinct. The query results will contain the first
74
- // result for each distinct combination of values for the given properties
75
- // (if empty, all results are returned).
76
- repeated PropertyReference distinct_on = 6;
77
-
78
- // A starting point for the query results. Query cursors are
79
- // returned in query result batches.
80
- bytes start_cursor = 7;
81
-
82
- // An ending point for the query results. Query cursors are
83
- // returned in query result batches.
84
- bytes end_cursor = 8;
85
-
86
- // The number of results to skip. Applies before limit, but after all other
87
- // constraints.
88
- // Must be >= 0.
89
- int32 offset = 10;
90
-
91
- // The maximum number of results to return. Applies after all other
92
- // constraints.
93
- // Unspecified is interpreted as no limit.
94
- // Must be >= 0.
95
- google.protobuf.Int32Value limit = 12;
96
- }
97
-
98
- // A representation of a kind.
99
- message KindExpression {
100
- // The name of the kind.
101
- string name = 1;
102
- }
103
-
104
- // A reference to a property relative to the kind expressions.
105
- message PropertyReference {
106
- // The name of the property.
107
- string name = 2;
108
- }
109
-
110
- // A representation of a property in a projection.
111
- message Projection {
112
- // The property to project.
113
- PropertyReference property = 1;
114
- }
115
-
116
- // The desired order for a specific property.
117
- message PropertyOrder {
118
- // Direction.
119
- enum Direction {
120
- // Unspecified.
121
- DIRECTION_UNSPECIFIED = 0;
122
-
123
- // Ascending.
124
- ASCENDING = 1;
125
-
126
- // Descending.
127
- DESCENDING = 2;
128
- }
129
-
130
- // The property to order by.
131
- PropertyReference property = 1;
132
-
133
- // The direction to order by. Defaults to `ASCENDING`.
134
- Direction direction = 2;
135
- }
136
-
137
- // A holder for any type of filter.
138
- message Filter {
139
- // The type of filter.
140
- oneof filter_type {
141
- // A composite filter.
142
- CompositeFilter composite_filter = 1;
143
-
144
- // A filter on a property.
145
- PropertyFilter property_filter = 2;
146
- }
147
- }
148
-
149
- // A filter that merges the multiple other filters using the given operator.
150
- message CompositeFilter {
151
- // Composite filter operator.
152
- enum Operator {
153
- // Unspecified. This value must not be used.
154
- OPERATOR_UNSPECIFIED = 0;
155
-
156
- // And.
157
- AND = 1;
158
- }
159
-
160
- // The operator for combining multiple filters.
161
- Operator op = 1;
162
-
163
- // The list of filters to combine.
164
- // Must contain at least one filter.
165
- repeated Filter filters = 2;
166
- }
167
-
168
- // A filter on a specific property.
169
- message PropertyFilter {
170
- // Property filter operator.
171
- enum Operator {
172
- // Unspecified. This value must not be used.
173
- OPERATOR_UNSPECIFIED = 0;
174
-
175
- // Less than.
176
- LESS_THAN = 1;
177
-
178
- // Less than or equal.
179
- LESS_THAN_OR_EQUAL = 2;
180
-
181
- // Greater than.
182
- GREATER_THAN = 3;
183
-
184
- // Greater than or equal.
185
- GREATER_THAN_OR_EQUAL = 4;
186
-
187
- // Equal.
188
- EQUAL = 5;
189
-
190
- // Has ancestor.
191
- HAS_ANCESTOR = 11;
192
- }
193
-
194
- // The property to filter by.
195
- PropertyReference property = 1;
196
-
197
- // The operator to filter by.
198
- Operator op = 2;
199
-
200
- // The value to compare the property to.
201
- Value value = 3;
202
- }
203
-
204
- // A GQL query.
205
- message GqlQuery {
206
- // A string of the format described
207
- // [here](https://developers.google.com/datastore/docs/concepts/gql).
208
- string query_string = 1;
209
-
210
- // When false, the query string must not contain any literals and instead
211
- // must bind all values. For example,
212
- // `SELECT * FROM Kind WHERE a = 'string literal'` is not allowed, while
213
- // `SELECT * FROM Kind WHERE a = @value` is.
214
- bool allow_literals = 2;
215
-
216
- // For each non-reserved named binding site in the query string,
217
- // there must be a named parameter with that name,
218
- // but not necessarily the inverse.
219
- // Key must match regex `[A-Za-z_$][A-Za-z_$0-9]*`, must not match regex
220
- // `__.*__`, and must not be `""`.
221
- map<string, GqlQueryParameter> named_bindings = 5;
222
-
223
- // Numbered binding site @1 references the first numbered parameter,
224
- // effectively using 1-based indexing, rather than the usual 0.
225
- // For each binding site numbered i in `query_string`,
226
- // there must be an i-th numbered parameter.
227
- // The inverse must also be true.
228
- repeated GqlQueryParameter positional_bindings = 4;
229
- }
230
-
231
- // A binding parameter for a GQL query.
232
- message GqlQueryParameter {
233
- // The type of parameter.
234
- oneof parameter_type {
235
- // Value.
236
- Value value = 2;
237
-
238
- // Cursor.
239
- bytes cursor = 3;
240
- }
241
- }
242
-
243
- // A batch of results produced by a query.
244
- message QueryResultBatch {
245
- // The possible values for the `more_results` field.
246
- enum MoreResultsType {
247
- // Unspecified. This value is never used.
248
- MORE_RESULTS_TYPE_UNSPECIFIED = 0;
249
-
250
- // There are additional batches to fetch from this query.
251
- NOT_FINISHED = 1;
252
-
253
- // The query is finished, but there may be more results after the limit.
254
- MORE_RESULTS_AFTER_LIMIT = 2;
255
-
256
- // The query is finished, but there may be more results after the end cursor.
257
- MORE_RESULTS_AFTER_CURSOR = 4;
258
-
259
- // The query has been exhausted.
260
- NO_MORE_RESULTS = 3;
261
- }
262
-
263
- // The number of results skipped, typically because of an offset.
264
- int32 skipped_results = 6;
265
-
266
- // A cursor that points to the position after the last skipped result.
267
- // Will be set when `skipped_results` != 0.
268
- bytes skipped_cursor = 3;
269
-
270
- // The result type for every entity in `entity_results`.
271
- EntityResult.ResultType entity_result_type = 1;
272
-
273
- // The results for this batch.
274
- repeated EntityResult entity_results = 2;
275
-
276
- // A cursor that points to the position after the last result in the batch.
277
- bytes end_cursor = 4;
278
-
279
- // The state of the query after the current batch.
280
- MoreResultsType more_results = 5;
281
- }
@@ -1,144 +0,0 @@
1
- // Copyright (c) 2015, Google Inc.
2
- //
3
- // Licensed under the Apache License, Version 2.0 (the "License");
4
- // you may not use this file except in compliance with the License.
5
- // You may obtain a copy of the License at
6
- //
7
- // http://www.apache.org/licenses/LICENSE-2.0
8
- //
9
- // Unless required by applicable law or agreed to in writing, software
10
- // distributed under the License is distributed on an "AS IS" BASIS,
11
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- // See the License for the specific language governing permissions and
13
- // limitations under the License.
14
-
15
- syntax = "proto3";
16
-
17
- package google.longrunning;
18
-
19
- import "google/api/annotations.proto";
20
- import "google/protobuf/any.proto";
21
- import "google/protobuf/empty.proto";
22
- import "google/rpc/status.proto";
23
-
24
- option java_multiple_files = true;
25
- option java_outer_classname = "OperationsProto";
26
- option java_package = "com.google.longrunning";
27
-
28
-
29
- // Manages long-running operations with an API service.
30
- //
31
- // When an API method normally takes long time to complete, it can be designed
32
- // to return [Operation][google.longrunning.Operation] to the client, and the client can use this
33
- // interface to receive the real response asynchronously by polling the
34
- // operation resource, or using `google.watcher.v1.Watcher` interface to watch
35
- // the response, or pass the operation resource to another API (such as Google
36
- // Cloud Pub/Sub API) to receive the response. Any API service that returns
37
- // long-running operations should implement the `Operations` interface so
38
- // developers can have a consistent client experience.
39
- service Operations {
40
- // Gets the latest state of a long-running operation. Clients may use this
41
- // method to poll the operation result at intervals as recommended by the API
42
- // service.
43
- rpc GetOperation(GetOperationRequest) returns (Operation) {
44
- option (google.api.http) = { get: "/v1/{name=operations/**}" };
45
- }
46
-
47
- // Lists operations that match the specified filter in the request. If the
48
- // server doesn't support this method, it returns
49
- // `google.rpc.Code.UNIMPLEMENTED`.
50
- rpc ListOperations(ListOperationsRequest) returns (ListOperationsResponse) {
51
- option (google.api.http) = { get: "/v1/{name=operations}" };
52
- }
53
-
54
- // Starts asynchronous cancellation on a long-running operation. The server
55
- // makes a best effort to cancel the operation, but success is not
56
- // guaranteed. If the server doesn't support this method, it returns
57
- // `google.rpc.Code.UNIMPLEMENTED`. Clients may use
58
- // [Operations.GetOperation] or other methods to check whether the
59
- // cancellation succeeded or the operation completed despite cancellation.
60
- rpc CancelOperation(CancelOperationRequest) returns (google.protobuf.Empty) {
61
- option (google.api.http) = { post: "/v1/{name=operations/**}:cancel" body: "*" };
62
- }
63
-
64
- // Deletes a long-running operation. It indicates the client is no longer
65
- // interested in the operation result. It does not cancel the operation.
66
- rpc DeleteOperation(DeleteOperationRequest) returns (google.protobuf.Empty) {
67
- option (google.api.http) = { delete: "/v1/{name=operations/**}" };
68
- }
69
- }
70
-
71
- // This resource represents a long-running operation that is the result of a
72
- // network API call.
73
- message Operation {
74
- // The name of the operation resource, which is only unique within the same
75
- // service that originally returns it.
76
- string name = 1;
77
-
78
- // Some service-specific metadata associated with the operation. It typically
79
- // contains progress information and common metadata such as create time.
80
- // Some services may not provide such metadata. Any method that returns a
81
- // long-running operation should document the metadata type, if any.
82
- google.protobuf.Any metadata = 2;
83
-
84
- // If the value is false, it means the operation is still in progress.
85
- // If true, the operation is completed and the `result` is available.
86
- bool done = 3;
87
-
88
- oneof result {
89
- // The error result of the operation in case of failure.
90
- google.rpc.Status error = 4;
91
-
92
- // The normal response of the operation in case of success. If the original
93
- // method returns no data on success, such as `Delete`, the response will be
94
- // `google.protobuf.Empty`. If the original method is standard
95
- // `Get`/`Create`/`Update`, the response should be the resource. For other
96
- // methods, the response should have the type `XxxResponse`, where `Xxx`
97
- // is the original method name. For example, if the original method name
98
- // is `TakeSnapshot()`, the inferred response type will be
99
- // `TakeSnapshotResponse`.
100
- google.protobuf.Any response = 5;
101
- }
102
- }
103
-
104
- // The request message for [Operations.GetOperation][google.longrunning.Operations.GetOperation].
105
- message GetOperationRequest {
106
- // The name of the operation resource.
107
- string name = 1;
108
- }
109
-
110
- // The request message for [Operations.ListOperations][google.longrunning.Operations.ListOperations].
111
- message ListOperationsRequest {
112
- // The name of the operation collection.
113
- string name = 4;
114
-
115
- // The standard List filter.
116
- string filter = 1;
117
-
118
- // The standard List page size.
119
- int32 page_size = 2;
120
-
121
- // The standard List page token.
122
- string page_token = 3;
123
- }
124
-
125
- // The response message for [Operations.ListOperations][google.longrunning.Operations.ListOperations].
126
- message ListOperationsResponse {
127
- // A list of operations that match the specified filter in the request.
128
- repeated Operation operations = 1;
129
-
130
- // The standard List next-page token.
131
- string next_page_token = 2;
132
- }
133
-
134
- // The request message for [Operations.CancelOperation][google.longrunning.Operations.CancelOperation].
135
- message CancelOperationRequest {
136
- // The name of the operation resource to be cancelled.
137
- string name = 1;
138
- }
139
-
140
- // The request message for [Operations.DeleteOperation][google.longrunning.Operations.DeleteOperation].
141
- message DeleteOperationRequest {
142
- // The name of the operation resource to be deleted.
143
- string name = 1;
144
- }
@@ -1,98 +0,0 @@
1
- // Protocol Buffers - Google's data interchange format
2
- // Copyright 2008 Google Inc. All rights reserved.
3
- // https://developers.google.com/protocol-buffers/
4
- //
5
- // Redistribution and use in source and binary forms, with or without
6
- // modification, are permitted provided that the following conditions are
7
- // met:
8
- //
9
- // * Redistributions of source code must retain the above copyright
10
- // notice, this list of conditions and the following disclaimer.
11
- // * Redistributions in binary form must reproduce the above
12
- // copyright notice, this list of conditions and the following disclaimer
13
- // in the documentation and/or other materials provided with the
14
- // distribution.
15
- // * Neither the name of Google Inc. nor the names of its
16
- // contributors may be used to endorse or promote products derived from
17
- // this software without specific prior written permission.
18
- //
19
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20
- // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21
- // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22
- // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23
- // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24
- // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25
- // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26
- // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27
- // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28
- // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
- // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
- syntax = "proto3";
31
-
32
- package google.protobuf;
33
-
34
- option java_generate_equals_and_hash = true;
35
- option java_multiple_files = true;
36
- option java_outer_classname = "AnyProto";
37
- option java_package = "com.google.protobuf";
38
- option csharp_namespace = "Google.Protobuf.WellKnownTypes";
39
- option objc_class_prefix = "GPB";
40
-
41
-
42
- // `Any` contains an arbitrary serialized message along with a URL
43
- // that describes the type of the serialized message.
44
- //
45
- // JSON
46
- // ====
47
- // The JSON representation of an `Any` value uses the regular
48
- // representation of the deserialized, embedded message, with an
49
- // additional field `@type` which contains the type URL. Example:
50
- //
51
- // package google.profile;
52
- // message Person {
53
- // string first_name = 1;
54
- // string last_name = 2;
55
- // }
56
- //
57
- // {
58
- // "@type": "type.googleapis.com/google.profile.Person",
59
- // "firstName": <string>,
60
- // "lastName": <string>
61
- // }
62
- //
63
- // If the embedded message type is well-known and has a custom JSON
64
- // representation, that representation will be embedded adding a field
65
- // `value` which holds the custom JSON in addition to the the `@type`
66
- // field. Example (for message [google.protobuf.Duration][google.protobuf.Duration]):
67
- //
68
- // {
69
- // "@type": "type.googleapis.com/google.protobuf.Duration",
70
- // "value": "1.212s"
71
- // }
72
- //
73
- message Any {
74
- // A URL/resource name whose content describes the type of the
75
- // serialized message.
76
- //
77
- // For URLs which use the schema `http`, `https`, or no schema, the
78
- // following restrictions and interpretations apply:
79
- //
80
- // * If no schema is provided, `https` is assumed.
81
- // * The last segment of the URL's path must represent the fully
82
- // qualified name of the type (as in `path/google.protobuf.Duration`).
83
- // * An HTTP GET on the URL must yield a [google.protobuf.Type][google.protobuf.Type]
84
- // value in binary format, or produce an error.
85
- // * Applications are allowed to cache lookup results based on the
86
- // URL, or have them precompiled into a binary to avoid any
87
- // lookup. Therefore, binary compatibility needs to be preserved
88
- // on changes to types. (Use versioned type names to manage
89
- // breaking changes.)
90
- //
91
- // Schemas other than `http`, `https` (or the empty schema) might be
92
- // used with implementation specific semantics.
93
- //
94
- string type_url = 1;
95
-
96
- // Must be valid serialized data of the above specified type.
97
- bytes value = 2;
98
- }
@@ -1,41 +0,0 @@
1
- // Protocol Buffers - Google's data interchange format
2
- // Copyright 2008 Google Inc. All rights reserved.
3
- // https://developers.google.com/protocol-buffers/
4
- //
5
- // Redistribution and use in source and binary forms, with or without
6
- // modification, are permitted provided that the following conditions are
7
- // met:
8
- //
9
- // * Redistributions of source code must retain the above copyright
10
- // notice, this list of conditions and the following disclaimer.
11
- // * Redistributions in binary form must reproduce the above
12
- // copyright notice, this list of conditions and the following disclaimer
13
- // in the documentation and/or other materials provided with the
14
- // distribution.
15
- // * Neither the name of Google Inc. nor the names of its
16
- // contributors may be used to endorse or promote products derived from
17
- // this software without specific prior written permission.
18
- //
19
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20
- // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21
- // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22
- // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23
- // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24
- // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25
- // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26
- // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27
- // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28
- // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
- // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
-
31
- syntax = "proto3";
32
-
33
- package protobuf_unittest;
34
-
35
- import "google/protobuf/any.proto";
36
-
37
- message TestAny {
38
- int32 int32_value = 1;
39
- google.protobuf.Any any_value = 2;
40
- repeated google.protobuf.Any repeated_any_value = 3;
41
- }