-
Notifications
You must be signed in to change notification settings - Fork 55
/
conformance_pb.ts
459 lines (412 loc) · 15.6 KB
/
conformance_pb.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
// Copyright 2021-2024 Buf Technologies, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// @generated by protoc-gen-es v1.7.0 with parameter "ts_nocheck=false,target=ts"
// @generated from file conformance/conformance.proto (package conformance, syntax proto3)
/* eslint-disable */
import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
import { Message, proto3 } from "@bufbuild/protobuf";
/**
* @generated from enum conformance.WireFormat
*/
export enum WireFormat {
/**
* @generated from enum value: UNSPECIFIED = 0;
*/
UNSPECIFIED = 0,
/**
* @generated from enum value: PROTOBUF = 1;
*/
PROTOBUF = 1,
/**
* @generated from enum value: JSON = 2;
*/
JSON = 2,
/**
* Only used inside Google. Opensource testees just skip it.
*
* @generated from enum value: JSPB = 3;
*/
JSPB = 3,
/**
* @generated from enum value: TEXT_FORMAT = 4;
*/
TEXT_FORMAT = 4,
}
// Retrieve enum metadata with: proto3.getEnumType(WireFormat)
proto3.util.setEnumType(WireFormat, "conformance.WireFormat", [
{ no: 0, name: "UNSPECIFIED" },
{ no: 1, name: "PROTOBUF" },
{ no: 2, name: "JSON" },
{ no: 3, name: "JSPB" },
{ no: 4, name: "TEXT_FORMAT" },
]);
/**
* @generated from enum conformance.TestCategory
*/
export enum TestCategory {
/**
* @generated from enum value: UNSPECIFIED_TEST = 0;
*/
UNSPECIFIED_TEST = 0,
/**
* Test binary wire format.
*
* @generated from enum value: BINARY_TEST = 1;
*/
BINARY_TEST = 1,
/**
* Test json wire format.
*
* @generated from enum value: JSON_TEST = 2;
*/
JSON_TEST = 2,
/**
* Similar to JSON_TEST. However, during parsing json, testee should ignore
* unknown fields. This feature is optional. Each implementation can decide
* whether to support it. See
* https://developers.google.com/protocol-buffers/docs/proto3#json_options
* for more detail.
*
* @generated from enum value: JSON_IGNORE_UNKNOWN_PARSING_TEST = 3;
*/
JSON_IGNORE_UNKNOWN_PARSING_TEST = 3,
/**
* Test jspb wire format. Only used inside Google. Opensource testees just
* skip it.
*
* @generated from enum value: JSPB_TEST = 4;
*/
JSPB_TEST = 4,
/**
* Test text format. For cpp, java and python, testees can already deal with
* this type. Testees of other languages can simply skip it.
*
* @generated from enum value: TEXT_FORMAT_TEST = 5;
*/
TEXT_FORMAT_TEST = 5,
}
// Retrieve enum metadata with: proto3.getEnumType(TestCategory)
proto3.util.setEnumType(TestCategory, "conformance.TestCategory", [
{ no: 0, name: "UNSPECIFIED_TEST" },
{ no: 1, name: "BINARY_TEST" },
{ no: 2, name: "JSON_TEST" },
{ no: 3, name: "JSON_IGNORE_UNKNOWN_PARSING_TEST" },
{ no: 4, name: "JSPB_TEST" },
{ no: 5, name: "TEXT_FORMAT_TEST" },
]);
/**
* The conformance runner will request a list of failures as the first request.
* This will be known by message_type == "conformance.FailureSet", a conformance
* test should return a serialized FailureSet in protobuf_payload.
*
* @generated from message conformance.FailureSet
*/
export class FailureSet extends Message<FailureSet> {
/**
* @generated from field: repeated string failure = 1;
*/
failure: string[] = [];
constructor(data?: PartialMessage<FailureSet>) {
super();
proto3.util.initPartial(data, this);
}
static readonly runtime: typeof proto3 = proto3;
static readonly typeName = "conformance.FailureSet";
static readonly fields: FieldList = proto3.util.newFieldList(() => [
{ no: 1, name: "failure", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true },
]);
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): FailureSet {
return new FailureSet().fromBinary(bytes, options);
}
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): FailureSet {
return new FailureSet().fromJson(jsonValue, options);
}
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): FailureSet {
return new FailureSet().fromJsonString(jsonString, options);
}
static equals(a: FailureSet | PlainMessage<FailureSet> | undefined, b: FailureSet | PlainMessage<FailureSet> | undefined): boolean {
return proto3.util.equals(FailureSet, a, b);
}
}
/**
* Represents a single test case's input. The testee should:
*
* 1. parse this proto (which should always succeed)
* 2. parse the protobuf or JSON payload in "payload" (which may fail)
* 3. if the parse succeeded, serialize the message in the requested format.
*
* @generated from message conformance.ConformanceRequest
*/
export class ConformanceRequest extends Message<ConformanceRequest> {
/**
* The payload (whether protobuf of JSON) is always for a
* protobuf_test_messages.proto3.TestAllTypes proto (as defined in
* src/google/protobuf/proto3_test_messages.proto).
*
* @generated from oneof conformance.ConformanceRequest.payload
*/
payload: {
/**
* @generated from field: bytes protobuf_payload = 1;
*/
value: Uint8Array;
case: "protobufPayload";
} | {
/**
* @generated from field: string json_payload = 2;
*/
value: string;
case: "jsonPayload";
} | {
/**
* Only used inside Google. Opensource testees just skip it.
*
* @generated from field: string jspb_payload = 7;
*/
value: string;
case: "jspbPayload";
} | {
/**
* @generated from field: string text_payload = 8;
*/
value: string;
case: "textPayload";
} | { case: undefined; value?: undefined } = { case: undefined };
/**
* Which format should the testee serialize its message to?
*
* @generated from field: conformance.WireFormat requested_output_format = 3;
*/
requestedOutputFormat = WireFormat.UNSPECIFIED;
/**
* The full name for the test message to use; for the moment, either:
* protobuf_test_messages.proto3.TestAllTypesProto3 or
* protobuf_test_messages.google.protobuf.TestAllTypesProto2.
*
* @generated from field: string message_type = 4;
*/
messageType = "";
/**
* Each test is given a specific test category. Some category may need
* specific support in testee programs. Refer to the definition of
* TestCategory for more information.
*
* @generated from field: conformance.TestCategory test_category = 5;
*/
testCategory = TestCategory.UNSPECIFIED_TEST;
/**
* Specify details for how to encode jspb.
*
* @generated from field: conformance.JspbEncodingConfig jspb_encoding_options = 6;
*/
jspbEncodingOptions?: JspbEncodingConfig;
/**
* This can be used in json and text format. If true, testee should print
* unknown fields instead of ignore. This feature is optional.
*
* @generated from field: bool print_unknown_fields = 9;
*/
printUnknownFields = false;
constructor(data?: PartialMessage<ConformanceRequest>) {
super();
proto3.util.initPartial(data, this);
}
static readonly runtime: typeof proto3 = proto3;
static readonly typeName = "conformance.ConformanceRequest";
static readonly fields: FieldList = proto3.util.newFieldList(() => [
{ no: 1, name: "protobuf_payload", kind: "scalar", T: 12 /* ScalarType.BYTES */, oneof: "payload" },
{ no: 2, name: "json_payload", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "payload" },
{ no: 7, name: "jspb_payload", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "payload" },
{ no: 8, name: "text_payload", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "payload" },
{ no: 3, name: "requested_output_format", kind: "enum", T: proto3.getEnumType(WireFormat) },
{ no: 4, name: "message_type", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 5, name: "test_category", kind: "enum", T: proto3.getEnumType(TestCategory) },
{ no: 6, name: "jspb_encoding_options", kind: "message", T: JspbEncodingConfig },
{ no: 9, name: "print_unknown_fields", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
]);
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ConformanceRequest {
return new ConformanceRequest().fromBinary(bytes, options);
}
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): ConformanceRequest {
return new ConformanceRequest().fromJson(jsonValue, options);
}
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ConformanceRequest {
return new ConformanceRequest().fromJsonString(jsonString, options);
}
static equals(a: ConformanceRequest | PlainMessage<ConformanceRequest> | undefined, b: ConformanceRequest | PlainMessage<ConformanceRequest> | undefined): boolean {
return proto3.util.equals(ConformanceRequest, a, b);
}
}
/**
* Represents a single test case's output.
*
* @generated from message conformance.ConformanceResponse
*/
export class ConformanceResponse extends Message<ConformanceResponse> {
/**
* @generated from oneof conformance.ConformanceResponse.result
*/
result: {
/**
* This string should be set to indicate parsing failed. The string can
* provide more information about the parse error if it is available.
*
* Setting this string does not necessarily mean the testee failed the
* test. Some of the test cases are intentionally invalid input.
*
* @generated from field: string parse_error = 1;
*/
value: string;
case: "parseError";
} | {
/**
* If the input was successfully parsed but errors occurred when
* serializing it to the requested output format, set the error message in
* this field.
*
* @generated from field: string serialize_error = 6;
*/
value: string;
case: "serializeError";
} | {
/**
* This should be set if the test program timed out. The string should
* provide more information about what the child process was doing when it
* was killed.
*
* @generated from field: string timeout_error = 9;
*/
value: string;
case: "timeoutError";
} | {
/**
* This should be set if some other error occurred. This will always
* indicate that the test failed. The string can provide more information
* about the failure.
*
* @generated from field: string runtime_error = 2;
*/
value: string;
case: "runtimeError";
} | {
/**
* If the input was successfully parsed and the requested output was
* protobuf, serialize it to protobuf and set it in this field.
*
* @generated from field: bytes protobuf_payload = 3;
*/
value: Uint8Array;
case: "protobufPayload";
} | {
/**
* If the input was successfully parsed and the requested output was JSON,
* serialize to JSON and set it in this field.
*
* @generated from field: string json_payload = 4;
*/
value: string;
case: "jsonPayload";
} | {
/**
* For when the testee skipped the test, likely because a certain feature
* wasn't supported, like JSON input/output.
*
* @generated from field: string skipped = 5;
*/
value: string;
case: "skipped";
} | {
/**
* If the input was successfully parsed and the requested output was JSPB,
* serialize to JSPB and set it in this field. JSPB is only used inside
* Google. Opensource testees can just skip it.
*
* @generated from field: string jspb_payload = 7;
*/
value: string;
case: "jspbPayload";
} | {
/**
* If the input was successfully parsed and the requested output was
* TEXT_FORMAT, serialize to TEXT_FORMAT and set it in this field.
*
* @generated from field: string text_payload = 8;
*/
value: string;
case: "textPayload";
} | { case: undefined; value?: undefined } = { case: undefined };
constructor(data?: PartialMessage<ConformanceResponse>) {
super();
proto3.util.initPartial(data, this);
}
static readonly runtime: typeof proto3 = proto3;
static readonly typeName = "conformance.ConformanceResponse";
static readonly fields: FieldList = proto3.util.newFieldList(() => [
{ no: 1, name: "parse_error", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "result" },
{ no: 6, name: "serialize_error", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "result" },
{ no: 9, name: "timeout_error", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "result" },
{ no: 2, name: "runtime_error", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "result" },
{ no: 3, name: "protobuf_payload", kind: "scalar", T: 12 /* ScalarType.BYTES */, oneof: "result" },
{ no: 4, name: "json_payload", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "result" },
{ no: 5, name: "skipped", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "result" },
{ no: 7, name: "jspb_payload", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "result" },
{ no: 8, name: "text_payload", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "result" },
]);
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ConformanceResponse {
return new ConformanceResponse().fromBinary(bytes, options);
}
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): ConformanceResponse {
return new ConformanceResponse().fromJson(jsonValue, options);
}
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ConformanceResponse {
return new ConformanceResponse().fromJsonString(jsonString, options);
}
static equals(a: ConformanceResponse | PlainMessage<ConformanceResponse> | undefined, b: ConformanceResponse | PlainMessage<ConformanceResponse> | undefined): boolean {
return proto3.util.equals(ConformanceResponse, a, b);
}
}
/**
* Encoding options for jspb format.
*
* @generated from message conformance.JspbEncodingConfig
*/
export class JspbEncodingConfig extends Message<JspbEncodingConfig> {
/**
* Encode the value field of Any as jspb array if true, otherwise binary.
*
* @generated from field: bool use_jspb_array_any_format = 1;
*/
useJspbArrayAnyFormat = false;
constructor(data?: PartialMessage<JspbEncodingConfig>) {
super();
proto3.util.initPartial(data, this);
}
static readonly runtime: typeof proto3 = proto3;
static readonly typeName = "conformance.JspbEncodingConfig";
static readonly fields: FieldList = proto3.util.newFieldList(() => [
{ no: 1, name: "use_jspb_array_any_format", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
]);
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): JspbEncodingConfig {
return new JspbEncodingConfig().fromBinary(bytes, options);
}
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): JspbEncodingConfig {
return new JspbEncodingConfig().fromJson(jsonValue, options);
}
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): JspbEncodingConfig {
return new JspbEncodingConfig().fromJsonString(jsonString, options);
}
static equals(a: JspbEncodingConfig | PlainMessage<JspbEncodingConfig> | undefined, b: JspbEncodingConfig | PlainMessage<JspbEncodingConfig> | undefined): boolean {
return proto3.util.equals(JspbEncodingConfig, a, b);
}
}