Conformance.cs 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179
  1. // <auto-generated>
  2. // Generated by the protocol buffer compiler. DO NOT EDIT!
  3. // source: conformance.proto
  4. // </auto-generated>
  5. #pragma warning disable 1591, 0612, 3021
  6. #region Designer generated code
  7. using pb = global::Google.Protobuf;
  8. using pbc = global::Google.Protobuf.Collections;
  9. using pbr = global::Google.Protobuf.Reflection;
  10. using scg = global::System.Collections.Generic;
  11. namespace Conformance {
  12. /// <summary>Holder for reflection information generated from conformance.proto</summary>
  13. public static partial class ConformanceReflection {
  14. #region Descriptor
  15. /// <summary>File descriptor for conformance.proto</summary>
  16. public static pbr::FileDescriptor Descriptor {
  17. get { return descriptor; }
  18. }
  19. private static pbr::FileDescriptor descriptor;
  20. static ConformanceReflection() {
  21. byte[] descriptorData = global::System.Convert.FromBase64String(
  22. string.Concat(
  23. "ChFjb25mb3JtYW5jZS5wcm90bxILY29uZm9ybWFuY2UiHQoKRmFpbHVyZVNl",
  24. "dBIPCgdmYWlsdXJlGAEgAygJIsUCChJDb25mb3JtYW5jZVJlcXVlc3QSGgoQ",
  25. "cHJvdG9idWZfcGF5bG9hZBgBIAEoDEgAEhYKDGpzb25fcGF5bG9hZBgCIAEo",
  26. "CUgAEhYKDGpzcGJfcGF5bG9hZBgHIAEoCUgAEhYKDHRleHRfcGF5bG9hZBgI",
  27. "IAEoCUgAEjgKF3JlcXVlc3RlZF9vdXRwdXRfZm9ybWF0GAMgASgOMhcuY29u",
  28. "Zm9ybWFuY2UuV2lyZUZvcm1hdBIUCgxtZXNzYWdlX3R5cGUYBCABKAkSMAoN",
  29. "dGVzdF9jYXRlZ29yeRgFIAEoDjIZLmNvbmZvcm1hbmNlLlRlc3RDYXRlZ29y",
  30. "eRI+ChVqc3BiX2VuY29kaW5nX29wdGlvbnMYBiABKAsyHy5jb25mb3JtYW5j",
  31. "ZS5Kc3BiRW5jb2RpbmdDb25maWdCCQoHcGF5bG9hZCLhAQoTQ29uZm9ybWFu",
  32. "Y2VSZXNwb25zZRIVCgtwYXJzZV9lcnJvchgBIAEoCUgAEhkKD3NlcmlhbGl6",
  33. "ZV9lcnJvchgGIAEoCUgAEhcKDXJ1bnRpbWVfZXJyb3IYAiABKAlIABIaChBw",
  34. "cm90b2J1Zl9wYXlsb2FkGAMgASgMSAASFgoManNvbl9wYXlsb2FkGAQgASgJ",
  35. "SAASEQoHc2tpcHBlZBgFIAEoCUgAEhYKDGpzcGJfcGF5bG9hZBgHIAEoCUgA",
  36. "EhYKDHRleHRfcGF5bG9hZBgIIAEoCUgAQggKBnJlc3VsdCI3ChJKc3BiRW5j",
  37. "b2RpbmdDb25maWcSIQoZdXNlX2pzcGJfYXJyYXlfYW55X2Zvcm1hdBgBIAEo",
  38. "CCpQCgpXaXJlRm9ybWF0Eg8KC1VOU1BFQ0lGSUVEEAASDAoIUFJPVE9CVUYQ",
  39. "ARIICgRKU09OEAISCAoESlNQQhADEg8KC1RFWFRfRk9STUFUEAQqjwEKDFRl",
  40. "c3RDYXRlZ29yeRIUChBVTlNQRUNJRklFRF9URVNUEAASDwoLQklOQVJZX1RF",
  41. "U1QQARINCglKU09OX1RFU1QQAhIkCiBKU09OX0lHTk9SRV9VTktOT1dOX1BB",
  42. "UlNJTkdfVEVTVBADEg0KCUpTUEJfVEVTVBAEEhQKEFRFWFRfRk9STUFUX1RF",
  43. "U1QQBUIhCh9jb20uZ29vZ2xlLnByb3RvYnVmLmNvbmZvcm1hbmNlYgZwcm90",
  44. "bzM="));
  45. descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
  46. new pbr::FileDescriptor[] { },
  47. new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Conformance.WireFormat), typeof(global::Conformance.TestCategory), }, new pbr::GeneratedClrTypeInfo[] {
  48. new pbr::GeneratedClrTypeInfo(typeof(global::Conformance.FailureSet), global::Conformance.FailureSet.Parser, new[]{ "Failure" }, null, null, null),
  49. new pbr::GeneratedClrTypeInfo(typeof(global::Conformance.ConformanceRequest), global::Conformance.ConformanceRequest.Parser, new[]{ "ProtobufPayload", "JsonPayload", "JspbPayload", "TextPayload", "RequestedOutputFormat", "MessageType", "TestCategory", "JspbEncodingOptions" }, new[]{ "Payload" }, null, null),
  50. new pbr::GeneratedClrTypeInfo(typeof(global::Conformance.ConformanceResponse), global::Conformance.ConformanceResponse.Parser, new[]{ "ParseError", "SerializeError", "RuntimeError", "ProtobufPayload", "JsonPayload", "Skipped", "JspbPayload", "TextPayload" }, new[]{ "Result" }, null, null),
  51. new pbr::GeneratedClrTypeInfo(typeof(global::Conformance.JspbEncodingConfig), global::Conformance.JspbEncodingConfig.Parser, new[]{ "UseJspbArrayAnyFormat" }, null, null, null)
  52. }));
  53. }
  54. #endregion
  55. }
  56. #region Enums
  57. public enum WireFormat {
  58. [pbr::OriginalName("UNSPECIFIED")] Unspecified = 0,
  59. [pbr::OriginalName("PROTOBUF")] Protobuf = 1,
  60. [pbr::OriginalName("JSON")] Json = 2,
  61. /// <summary>
  62. /// Google internal only. Opensource testees just skip it.
  63. /// </summary>
  64. [pbr::OriginalName("JSPB")] Jspb = 3,
  65. [pbr::OriginalName("TEXT_FORMAT")] TextFormat = 4,
  66. }
  67. public enum TestCategory {
  68. [pbr::OriginalName("UNSPECIFIED_TEST")] UnspecifiedTest = 0,
  69. /// <summary>
  70. /// Test binary wire format.
  71. /// </summary>
  72. [pbr::OriginalName("BINARY_TEST")] BinaryTest = 1,
  73. /// <summary>
  74. /// Test json wire format.
  75. /// </summary>
  76. [pbr::OriginalName("JSON_TEST")] JsonTest = 2,
  77. /// <summary>
  78. /// Similar to JSON_TEST. However, during parsing json, testee should ignore
  79. /// unknown fields. This feature is optional. Each implementation can descide
  80. /// whether to support it. See
  81. /// https://developers.google.com/protocol-buffers/docs/proto3#json_options
  82. /// for more detail.
  83. /// </summary>
  84. [pbr::OriginalName("JSON_IGNORE_UNKNOWN_PARSING_TEST")] JsonIgnoreUnknownParsingTest = 3,
  85. /// <summary>
  86. /// Test jspb wire format. Google internal only. Opensource testees just skip it.
  87. /// </summary>
  88. [pbr::OriginalName("JSPB_TEST")] JspbTest = 4,
  89. /// <summary>
  90. /// Test text format. For cpp, java and python, testees can already deal with
  91. /// this type. Testees of other languages can simply skip it.
  92. /// </summary>
  93. [pbr::OriginalName("TEXT_FORMAT_TEST")] TextFormatTest = 5,
  94. }
  95. #endregion
  96. #region Messages
  97. /// <summary>
  98. /// The conformance runner will request a list of failures as the first request.
  99. /// This will be known by message_type == "conformance.FailureSet", a conformance
  100. /// test should return a serialized FailureSet in protobuf_payload.
  101. /// </summary>
  102. public sealed partial class FailureSet : pb::IMessage<FailureSet> {
  103. private static readonly pb::MessageParser<FailureSet> _parser = new pb::MessageParser<FailureSet>(() => new FailureSet());
  104. private pb::UnknownFieldSet _unknownFields;
  105. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  106. public static pb::MessageParser<FailureSet> Parser { get { return _parser; } }
  107. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  108. public static pbr::MessageDescriptor Descriptor {
  109. get { return global::Conformance.ConformanceReflection.Descriptor.MessageTypes[0]; }
  110. }
  111. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  112. pbr::MessageDescriptor pb::IMessage.Descriptor {
  113. get { return Descriptor; }
  114. }
  115. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  116. public FailureSet() {
  117. OnConstruction();
  118. }
  119. partial void OnConstruction();
  120. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  121. public FailureSet(FailureSet other) : this() {
  122. failure_ = other.failure_.Clone();
  123. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  124. }
  125. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  126. public FailureSet Clone() {
  127. return new FailureSet(this);
  128. }
  129. /// <summary>Field number for the "failure" field.</summary>
  130. public const int FailureFieldNumber = 1;
  131. private static readonly pb::FieldCodec<string> _repeated_failure_codec
  132. = pb::FieldCodec.ForString(10);
  133. private readonly pbc::RepeatedField<string> failure_ = new pbc::RepeatedField<string>();
  134. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  135. public pbc::RepeatedField<string> Failure {
  136. get { return failure_; }
  137. }
  138. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  139. public override bool Equals(object other) {
  140. return Equals(other as FailureSet);
  141. }
  142. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  143. public bool Equals(FailureSet other) {
  144. if (ReferenceEquals(other, null)) {
  145. return false;
  146. }
  147. if (ReferenceEquals(other, this)) {
  148. return true;
  149. }
  150. if(!failure_.Equals(other.failure_)) return false;
  151. return Equals(_unknownFields, other._unknownFields);
  152. }
  153. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  154. public override int GetHashCode() {
  155. int hash = 1;
  156. hash ^= failure_.GetHashCode();
  157. if (_unknownFields != null) {
  158. hash ^= _unknownFields.GetHashCode();
  159. }
  160. return hash;
  161. }
  162. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  163. public override string ToString() {
  164. return pb::JsonFormatter.ToDiagnosticString(this);
  165. }
  166. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  167. public void WriteTo(pb::CodedOutputStream output) {
  168. failure_.WriteTo(output, _repeated_failure_codec);
  169. if (_unknownFields != null) {
  170. _unknownFields.WriteTo(output);
  171. }
  172. }
  173. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  174. public int CalculateSize() {
  175. int size = 0;
  176. size += failure_.CalculateSize(_repeated_failure_codec);
  177. if (_unknownFields != null) {
  178. size += _unknownFields.CalculateSize();
  179. }
  180. return size;
  181. }
  182. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  183. public void MergeFrom(FailureSet other) {
  184. if (other == null) {
  185. return;
  186. }
  187. failure_.Add(other.failure_);
  188. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  189. }
  190. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  191. public void MergeFrom(pb::CodedInputStream input) {
  192. uint tag;
  193. while ((tag = input.ReadTag()) != 0) {
  194. switch(tag) {
  195. default:
  196. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  197. break;
  198. case 10: {
  199. failure_.AddEntriesFrom(input, _repeated_failure_codec);
  200. break;
  201. }
  202. }
  203. }
  204. }
  205. }
  206. /// <summary>
  207. /// Represents a single test case's input. The testee should:
  208. ///
  209. /// 1. parse this proto (which should always succeed)
  210. /// 2. parse the protobuf or JSON payload in "payload" (which may fail)
  211. /// 3. if the parse succeeded, serialize the message in the requested format.
  212. /// </summary>
  213. public sealed partial class ConformanceRequest : pb::IMessage<ConformanceRequest> {
  214. private static readonly pb::MessageParser<ConformanceRequest> _parser = new pb::MessageParser<ConformanceRequest>(() => new ConformanceRequest());
  215. private pb::UnknownFieldSet _unknownFields;
  216. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  217. public static pb::MessageParser<ConformanceRequest> Parser { get { return _parser; } }
  218. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  219. public static pbr::MessageDescriptor Descriptor {
  220. get { return global::Conformance.ConformanceReflection.Descriptor.MessageTypes[1]; }
  221. }
  222. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  223. pbr::MessageDescriptor pb::IMessage.Descriptor {
  224. get { return Descriptor; }
  225. }
  226. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  227. public ConformanceRequest() {
  228. OnConstruction();
  229. }
  230. partial void OnConstruction();
  231. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  232. public ConformanceRequest(ConformanceRequest other) : this() {
  233. requestedOutputFormat_ = other.requestedOutputFormat_;
  234. messageType_ = other.messageType_;
  235. testCategory_ = other.testCategory_;
  236. jspbEncodingOptions_ = other.jspbEncodingOptions_ != null ? other.jspbEncodingOptions_.Clone() : null;
  237. switch (other.PayloadCase) {
  238. case PayloadOneofCase.ProtobufPayload:
  239. ProtobufPayload = other.ProtobufPayload;
  240. break;
  241. case PayloadOneofCase.JsonPayload:
  242. JsonPayload = other.JsonPayload;
  243. break;
  244. case PayloadOneofCase.JspbPayload:
  245. JspbPayload = other.JspbPayload;
  246. break;
  247. case PayloadOneofCase.TextPayload:
  248. TextPayload = other.TextPayload;
  249. break;
  250. }
  251. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  252. }
  253. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  254. public ConformanceRequest Clone() {
  255. return new ConformanceRequest(this);
  256. }
  257. /// <summary>Field number for the "protobuf_payload" field.</summary>
  258. public const int ProtobufPayloadFieldNumber = 1;
  259. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  260. public pb::ByteString ProtobufPayload {
  261. get { return payloadCase_ == PayloadOneofCase.ProtobufPayload ? (pb::ByteString) payload_ : pb::ByteString.Empty; }
  262. set {
  263. payload_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  264. payloadCase_ = PayloadOneofCase.ProtobufPayload;
  265. }
  266. }
  267. /// <summary>Field number for the "json_payload" field.</summary>
  268. public const int JsonPayloadFieldNumber = 2;
  269. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  270. public string JsonPayload {
  271. get { return payloadCase_ == PayloadOneofCase.JsonPayload ? (string) payload_ : ""; }
  272. set {
  273. payload_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  274. payloadCase_ = PayloadOneofCase.JsonPayload;
  275. }
  276. }
  277. /// <summary>Field number for the "jspb_payload" field.</summary>
  278. public const int JspbPayloadFieldNumber = 7;
  279. /// <summary>
  280. /// Google internal only. Opensource testees just skip it.
  281. /// </summary>
  282. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  283. public string JspbPayload {
  284. get { return payloadCase_ == PayloadOneofCase.JspbPayload ? (string) payload_ : ""; }
  285. set {
  286. payload_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  287. payloadCase_ = PayloadOneofCase.JspbPayload;
  288. }
  289. }
  290. /// <summary>Field number for the "text_payload" field.</summary>
  291. public const int TextPayloadFieldNumber = 8;
  292. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  293. public string TextPayload {
  294. get { return payloadCase_ == PayloadOneofCase.TextPayload ? (string) payload_ : ""; }
  295. set {
  296. payload_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  297. payloadCase_ = PayloadOneofCase.TextPayload;
  298. }
  299. }
  300. /// <summary>Field number for the "requested_output_format" field.</summary>
  301. public const int RequestedOutputFormatFieldNumber = 3;
  302. private global::Conformance.WireFormat requestedOutputFormat_ = 0;
  303. /// <summary>
  304. /// Which format should the testee serialize its message to?
  305. /// </summary>
  306. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  307. public global::Conformance.WireFormat RequestedOutputFormat {
  308. get { return requestedOutputFormat_; }
  309. set {
  310. requestedOutputFormat_ = value;
  311. }
  312. }
  313. /// <summary>Field number for the "message_type" field.</summary>
  314. public const int MessageTypeFieldNumber = 4;
  315. private string messageType_ = "";
  316. /// <summary>
  317. /// The full name for the test message to use; for the moment, either:
  318. /// protobuf_test_messages.proto3.TestAllTypesProto3 or
  319. /// protobuf_test_messages.proto2.TestAllTypesProto2.
  320. /// </summary>
  321. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  322. public string MessageType {
  323. get { return messageType_; }
  324. set {
  325. messageType_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  326. }
  327. }
  328. /// <summary>Field number for the "test_category" field.</summary>
  329. public const int TestCategoryFieldNumber = 5;
  330. private global::Conformance.TestCategory testCategory_ = 0;
  331. /// <summary>
  332. /// Each test is given a specific test category. Some category may need
  333. /// spedific support in testee programs. Refer to the defintion of TestCategory
  334. /// for more information.
  335. /// </summary>
  336. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  337. public global::Conformance.TestCategory TestCategory {
  338. get { return testCategory_; }
  339. set {
  340. testCategory_ = value;
  341. }
  342. }
  343. /// <summary>Field number for the "jspb_encoding_options" field.</summary>
  344. public const int JspbEncodingOptionsFieldNumber = 6;
  345. private global::Conformance.JspbEncodingConfig jspbEncodingOptions_;
  346. /// <summary>
  347. /// Specify details for how to encode jspb.
  348. /// </summary>
  349. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  350. public global::Conformance.JspbEncodingConfig JspbEncodingOptions {
  351. get { return jspbEncodingOptions_; }
  352. set {
  353. jspbEncodingOptions_ = value;
  354. }
  355. }
  356. private object payload_;
  357. /// <summary>Enum of possible cases for the "payload" oneof.</summary>
  358. public enum PayloadOneofCase {
  359. None = 0,
  360. ProtobufPayload = 1,
  361. JsonPayload = 2,
  362. JspbPayload = 7,
  363. TextPayload = 8,
  364. }
  365. private PayloadOneofCase payloadCase_ = PayloadOneofCase.None;
  366. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  367. public PayloadOneofCase PayloadCase {
  368. get { return payloadCase_; }
  369. }
  370. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  371. public void ClearPayload() {
  372. payloadCase_ = PayloadOneofCase.None;
  373. payload_ = null;
  374. }
  375. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  376. public override bool Equals(object other) {
  377. return Equals(other as ConformanceRequest);
  378. }
  379. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  380. public bool Equals(ConformanceRequest other) {
  381. if (ReferenceEquals(other, null)) {
  382. return false;
  383. }
  384. if (ReferenceEquals(other, this)) {
  385. return true;
  386. }
  387. if (ProtobufPayload != other.ProtobufPayload) return false;
  388. if (JsonPayload != other.JsonPayload) return false;
  389. if (JspbPayload != other.JspbPayload) return false;
  390. if (TextPayload != other.TextPayload) return false;
  391. if (RequestedOutputFormat != other.RequestedOutputFormat) return false;
  392. if (MessageType != other.MessageType) return false;
  393. if (TestCategory != other.TestCategory) return false;
  394. if (!object.Equals(JspbEncodingOptions, other.JspbEncodingOptions)) return false;
  395. if (PayloadCase != other.PayloadCase) return false;
  396. return Equals(_unknownFields, other._unknownFields);
  397. }
  398. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  399. public override int GetHashCode() {
  400. int hash = 1;
  401. if (payloadCase_ == PayloadOneofCase.ProtobufPayload) hash ^= ProtobufPayload.GetHashCode();
  402. if (payloadCase_ == PayloadOneofCase.JsonPayload) hash ^= JsonPayload.GetHashCode();
  403. if (payloadCase_ == PayloadOneofCase.JspbPayload) hash ^= JspbPayload.GetHashCode();
  404. if (payloadCase_ == PayloadOneofCase.TextPayload) hash ^= TextPayload.GetHashCode();
  405. if (RequestedOutputFormat != 0) hash ^= RequestedOutputFormat.GetHashCode();
  406. if (MessageType.Length != 0) hash ^= MessageType.GetHashCode();
  407. if (TestCategory != 0) hash ^= TestCategory.GetHashCode();
  408. if (jspbEncodingOptions_ != null) hash ^= JspbEncodingOptions.GetHashCode();
  409. hash ^= (int) payloadCase_;
  410. if (_unknownFields != null) {
  411. hash ^= _unknownFields.GetHashCode();
  412. }
  413. return hash;
  414. }
  415. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  416. public override string ToString() {
  417. return pb::JsonFormatter.ToDiagnosticString(this);
  418. }
  419. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  420. public void WriteTo(pb::CodedOutputStream output) {
  421. if (payloadCase_ == PayloadOneofCase.ProtobufPayload) {
  422. output.WriteRawTag(10);
  423. output.WriteBytes(ProtobufPayload);
  424. }
  425. if (payloadCase_ == PayloadOneofCase.JsonPayload) {
  426. output.WriteRawTag(18);
  427. output.WriteString(JsonPayload);
  428. }
  429. if (RequestedOutputFormat != 0) {
  430. output.WriteRawTag(24);
  431. output.WriteEnum((int) RequestedOutputFormat);
  432. }
  433. if (MessageType.Length != 0) {
  434. output.WriteRawTag(34);
  435. output.WriteString(MessageType);
  436. }
  437. if (TestCategory != 0) {
  438. output.WriteRawTag(40);
  439. output.WriteEnum((int) TestCategory);
  440. }
  441. if (jspbEncodingOptions_ != null) {
  442. output.WriteRawTag(50);
  443. output.WriteMessage(JspbEncodingOptions);
  444. }
  445. if (payloadCase_ == PayloadOneofCase.JspbPayload) {
  446. output.WriteRawTag(58);
  447. output.WriteString(JspbPayload);
  448. }
  449. if (payloadCase_ == PayloadOneofCase.TextPayload) {
  450. output.WriteRawTag(66);
  451. output.WriteString(TextPayload);
  452. }
  453. if (_unknownFields != null) {
  454. _unknownFields.WriteTo(output);
  455. }
  456. }
  457. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  458. public int CalculateSize() {
  459. int size = 0;
  460. if (payloadCase_ == PayloadOneofCase.ProtobufPayload) {
  461. size += 1 + pb::CodedOutputStream.ComputeBytesSize(ProtobufPayload);
  462. }
  463. if (payloadCase_ == PayloadOneofCase.JsonPayload) {
  464. size += 1 + pb::CodedOutputStream.ComputeStringSize(JsonPayload);
  465. }
  466. if (payloadCase_ == PayloadOneofCase.JspbPayload) {
  467. size += 1 + pb::CodedOutputStream.ComputeStringSize(JspbPayload);
  468. }
  469. if (payloadCase_ == PayloadOneofCase.TextPayload) {
  470. size += 1 + pb::CodedOutputStream.ComputeStringSize(TextPayload);
  471. }
  472. if (RequestedOutputFormat != 0) {
  473. size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) RequestedOutputFormat);
  474. }
  475. if (MessageType.Length != 0) {
  476. size += 1 + pb::CodedOutputStream.ComputeStringSize(MessageType);
  477. }
  478. if (TestCategory != 0) {
  479. size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) TestCategory);
  480. }
  481. if (jspbEncodingOptions_ != null) {
  482. size += 1 + pb::CodedOutputStream.ComputeMessageSize(JspbEncodingOptions);
  483. }
  484. if (_unknownFields != null) {
  485. size += _unknownFields.CalculateSize();
  486. }
  487. return size;
  488. }
  489. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  490. public void MergeFrom(ConformanceRequest other) {
  491. if (other == null) {
  492. return;
  493. }
  494. if (other.RequestedOutputFormat != 0) {
  495. RequestedOutputFormat = other.RequestedOutputFormat;
  496. }
  497. if (other.MessageType.Length != 0) {
  498. MessageType = other.MessageType;
  499. }
  500. if (other.TestCategory != 0) {
  501. TestCategory = other.TestCategory;
  502. }
  503. if (other.jspbEncodingOptions_ != null) {
  504. if (jspbEncodingOptions_ == null) {
  505. JspbEncodingOptions = new global::Conformance.JspbEncodingConfig();
  506. }
  507. JspbEncodingOptions.MergeFrom(other.JspbEncodingOptions);
  508. }
  509. switch (other.PayloadCase) {
  510. case PayloadOneofCase.ProtobufPayload:
  511. ProtobufPayload = other.ProtobufPayload;
  512. break;
  513. case PayloadOneofCase.JsonPayload:
  514. JsonPayload = other.JsonPayload;
  515. break;
  516. case PayloadOneofCase.JspbPayload:
  517. JspbPayload = other.JspbPayload;
  518. break;
  519. case PayloadOneofCase.TextPayload:
  520. TextPayload = other.TextPayload;
  521. break;
  522. }
  523. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  524. }
  525. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  526. public void MergeFrom(pb::CodedInputStream input) {
  527. uint tag;
  528. while ((tag = input.ReadTag()) != 0) {
  529. switch(tag) {
  530. default:
  531. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  532. break;
  533. case 10: {
  534. ProtobufPayload = input.ReadBytes();
  535. break;
  536. }
  537. case 18: {
  538. JsonPayload = input.ReadString();
  539. break;
  540. }
  541. case 24: {
  542. RequestedOutputFormat = (global::Conformance.WireFormat) input.ReadEnum();
  543. break;
  544. }
  545. case 34: {
  546. MessageType = input.ReadString();
  547. break;
  548. }
  549. case 40: {
  550. TestCategory = (global::Conformance.TestCategory) input.ReadEnum();
  551. break;
  552. }
  553. case 50: {
  554. if (jspbEncodingOptions_ == null) {
  555. JspbEncodingOptions = new global::Conformance.JspbEncodingConfig();
  556. }
  557. input.ReadMessage(JspbEncodingOptions);
  558. break;
  559. }
  560. case 58: {
  561. JspbPayload = input.ReadString();
  562. break;
  563. }
  564. case 66: {
  565. TextPayload = input.ReadString();
  566. break;
  567. }
  568. }
  569. }
  570. }
  571. }
  572. /// <summary>
  573. /// Represents a single test case's output.
  574. /// </summary>
  575. public sealed partial class ConformanceResponse : pb::IMessage<ConformanceResponse> {
  576. private static readonly pb::MessageParser<ConformanceResponse> _parser = new pb::MessageParser<ConformanceResponse>(() => new ConformanceResponse());
  577. private pb::UnknownFieldSet _unknownFields;
  578. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  579. public static pb::MessageParser<ConformanceResponse> Parser { get { return _parser; } }
  580. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  581. public static pbr::MessageDescriptor Descriptor {
  582. get { return global::Conformance.ConformanceReflection.Descriptor.MessageTypes[2]; }
  583. }
  584. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  585. pbr::MessageDescriptor pb::IMessage.Descriptor {
  586. get { return Descriptor; }
  587. }
  588. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  589. public ConformanceResponse() {
  590. OnConstruction();
  591. }
  592. partial void OnConstruction();
  593. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  594. public ConformanceResponse(ConformanceResponse other) : this() {
  595. switch (other.ResultCase) {
  596. case ResultOneofCase.ParseError:
  597. ParseError = other.ParseError;
  598. break;
  599. case ResultOneofCase.SerializeError:
  600. SerializeError = other.SerializeError;
  601. break;
  602. case ResultOneofCase.RuntimeError:
  603. RuntimeError = other.RuntimeError;
  604. break;
  605. case ResultOneofCase.ProtobufPayload:
  606. ProtobufPayload = other.ProtobufPayload;
  607. break;
  608. case ResultOneofCase.JsonPayload:
  609. JsonPayload = other.JsonPayload;
  610. break;
  611. case ResultOneofCase.Skipped:
  612. Skipped = other.Skipped;
  613. break;
  614. case ResultOneofCase.JspbPayload:
  615. JspbPayload = other.JspbPayload;
  616. break;
  617. case ResultOneofCase.TextPayload:
  618. TextPayload = other.TextPayload;
  619. break;
  620. }
  621. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  622. }
  623. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  624. public ConformanceResponse Clone() {
  625. return new ConformanceResponse(this);
  626. }
  627. /// <summary>Field number for the "parse_error" field.</summary>
  628. public const int ParseErrorFieldNumber = 1;
  629. /// <summary>
  630. /// This string should be set to indicate parsing failed. The string can
  631. /// provide more information about the parse error if it is available.
  632. ///
  633. /// Setting this string does not necessarily mean the testee failed the
  634. /// test. Some of the test cases are intentionally invalid input.
  635. /// </summary>
  636. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  637. public string ParseError {
  638. get { return resultCase_ == ResultOneofCase.ParseError ? (string) result_ : ""; }
  639. set {
  640. result_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  641. resultCase_ = ResultOneofCase.ParseError;
  642. }
  643. }
  644. /// <summary>Field number for the "serialize_error" field.</summary>
  645. public const int SerializeErrorFieldNumber = 6;
  646. /// <summary>
  647. /// If the input was successfully parsed but errors occurred when
  648. /// serializing it to the requested output format, set the error message in
  649. /// this field.
  650. /// </summary>
  651. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  652. public string SerializeError {
  653. get { return resultCase_ == ResultOneofCase.SerializeError ? (string) result_ : ""; }
  654. set {
  655. result_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  656. resultCase_ = ResultOneofCase.SerializeError;
  657. }
  658. }
  659. /// <summary>Field number for the "runtime_error" field.</summary>
  660. public const int RuntimeErrorFieldNumber = 2;
  661. /// <summary>
  662. /// This should be set if some other error occurred. This will always
  663. /// indicate that the test failed. The string can provide more information
  664. /// about the failure.
  665. /// </summary>
  666. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  667. public string RuntimeError {
  668. get { return resultCase_ == ResultOneofCase.RuntimeError ? (string) result_ : ""; }
  669. set {
  670. result_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  671. resultCase_ = ResultOneofCase.RuntimeError;
  672. }
  673. }
  674. /// <summary>Field number for the "protobuf_payload" field.</summary>
  675. public const int ProtobufPayloadFieldNumber = 3;
  676. /// <summary>
  677. /// If the input was successfully parsed and the requested output was
  678. /// protobuf, serialize it to protobuf and set it in this field.
  679. /// </summary>
  680. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  681. public pb::ByteString ProtobufPayload {
  682. get { return resultCase_ == ResultOneofCase.ProtobufPayload ? (pb::ByteString) result_ : pb::ByteString.Empty; }
  683. set {
  684. result_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  685. resultCase_ = ResultOneofCase.ProtobufPayload;
  686. }
  687. }
  688. /// <summary>Field number for the "json_payload" field.</summary>
  689. public const int JsonPayloadFieldNumber = 4;
  690. /// <summary>
  691. /// If the input was successfully parsed and the requested output was JSON,
  692. /// serialize to JSON and set it in this field.
  693. /// </summary>
  694. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  695. public string JsonPayload {
  696. get { return resultCase_ == ResultOneofCase.JsonPayload ? (string) result_ : ""; }
  697. set {
  698. result_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  699. resultCase_ = ResultOneofCase.JsonPayload;
  700. }
  701. }
  702. /// <summary>Field number for the "skipped" field.</summary>
  703. public const int SkippedFieldNumber = 5;
  704. /// <summary>
  705. /// For when the testee skipped the test, likely because a certain feature
  706. /// wasn't supported, like JSON input/output.
  707. /// </summary>
  708. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  709. public string Skipped {
  710. get { return resultCase_ == ResultOneofCase.Skipped ? (string) result_ : ""; }
  711. set {
  712. result_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  713. resultCase_ = ResultOneofCase.Skipped;
  714. }
  715. }
  716. /// <summary>Field number for the "jspb_payload" field.</summary>
  717. public const int JspbPayloadFieldNumber = 7;
  718. /// <summary>
  719. /// If the input was successfully parsed and the requested output was JSPB,
  720. /// serialize to JSPB and set it in this field. JSPB is google internal only
  721. /// format. Opensource testees can just skip it.
  722. /// </summary>
  723. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  724. public string JspbPayload {
  725. get { return resultCase_ == ResultOneofCase.JspbPayload ? (string) result_ : ""; }
  726. set {
  727. result_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  728. resultCase_ = ResultOneofCase.JspbPayload;
  729. }
  730. }
  731. /// <summary>Field number for the "text_payload" field.</summary>
  732. public const int TextPayloadFieldNumber = 8;
  733. /// <summary>
  734. /// If the input was successfully parsed and the requested output was
  735. /// TEXT_FORMAT, serialize to TEXT_FORMAT and set it in this field.
  736. /// </summary>
  737. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  738. public string TextPayload {
  739. get { return resultCase_ == ResultOneofCase.TextPayload ? (string) result_ : ""; }
  740. set {
  741. result_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  742. resultCase_ = ResultOneofCase.TextPayload;
  743. }
  744. }
  745. private object result_;
  746. /// <summary>Enum of possible cases for the "result" oneof.</summary>
  747. public enum ResultOneofCase {
  748. None = 0,
  749. ParseError = 1,
  750. SerializeError = 6,
  751. RuntimeError = 2,
  752. ProtobufPayload = 3,
  753. JsonPayload = 4,
  754. Skipped = 5,
  755. JspbPayload = 7,
  756. TextPayload = 8,
  757. }
  758. private ResultOneofCase resultCase_ = ResultOneofCase.None;
  759. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  760. public ResultOneofCase ResultCase {
  761. get { return resultCase_; }
  762. }
  763. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  764. public void ClearResult() {
  765. resultCase_ = ResultOneofCase.None;
  766. result_ = null;
  767. }
  768. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  769. public override bool Equals(object other) {
  770. return Equals(other as ConformanceResponse);
  771. }
  772. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  773. public bool Equals(ConformanceResponse other) {
  774. if (ReferenceEquals(other, null)) {
  775. return false;
  776. }
  777. if (ReferenceEquals(other, this)) {
  778. return true;
  779. }
  780. if (ParseError != other.ParseError) return false;
  781. if (SerializeError != other.SerializeError) return false;
  782. if (RuntimeError != other.RuntimeError) return false;
  783. if (ProtobufPayload != other.ProtobufPayload) return false;
  784. if (JsonPayload != other.JsonPayload) return false;
  785. if (Skipped != other.Skipped) return false;
  786. if (JspbPayload != other.JspbPayload) return false;
  787. if (TextPayload != other.TextPayload) return false;
  788. if (ResultCase != other.ResultCase) return false;
  789. return Equals(_unknownFields, other._unknownFields);
  790. }
  791. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  792. public override int GetHashCode() {
  793. int hash = 1;
  794. if (resultCase_ == ResultOneofCase.ParseError) hash ^= ParseError.GetHashCode();
  795. if (resultCase_ == ResultOneofCase.SerializeError) hash ^= SerializeError.GetHashCode();
  796. if (resultCase_ == ResultOneofCase.RuntimeError) hash ^= RuntimeError.GetHashCode();
  797. if (resultCase_ == ResultOneofCase.ProtobufPayload) hash ^= ProtobufPayload.GetHashCode();
  798. if (resultCase_ == ResultOneofCase.JsonPayload) hash ^= JsonPayload.GetHashCode();
  799. if (resultCase_ == ResultOneofCase.Skipped) hash ^= Skipped.GetHashCode();
  800. if (resultCase_ == ResultOneofCase.JspbPayload) hash ^= JspbPayload.GetHashCode();
  801. if (resultCase_ == ResultOneofCase.TextPayload) hash ^= TextPayload.GetHashCode();
  802. hash ^= (int) resultCase_;
  803. if (_unknownFields != null) {
  804. hash ^= _unknownFields.GetHashCode();
  805. }
  806. return hash;
  807. }
  808. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  809. public override string ToString() {
  810. return pb::JsonFormatter.ToDiagnosticString(this);
  811. }
  812. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  813. public void WriteTo(pb::CodedOutputStream output) {
  814. if (resultCase_ == ResultOneofCase.ParseError) {
  815. output.WriteRawTag(10);
  816. output.WriteString(ParseError);
  817. }
  818. if (resultCase_ == ResultOneofCase.RuntimeError) {
  819. output.WriteRawTag(18);
  820. output.WriteString(RuntimeError);
  821. }
  822. if (resultCase_ == ResultOneofCase.ProtobufPayload) {
  823. output.WriteRawTag(26);
  824. output.WriteBytes(ProtobufPayload);
  825. }
  826. if (resultCase_ == ResultOneofCase.JsonPayload) {
  827. output.WriteRawTag(34);
  828. output.WriteString(JsonPayload);
  829. }
  830. if (resultCase_ == ResultOneofCase.Skipped) {
  831. output.WriteRawTag(42);
  832. output.WriteString(Skipped);
  833. }
  834. if (resultCase_ == ResultOneofCase.SerializeError) {
  835. output.WriteRawTag(50);
  836. output.WriteString(SerializeError);
  837. }
  838. if (resultCase_ == ResultOneofCase.JspbPayload) {
  839. output.WriteRawTag(58);
  840. output.WriteString(JspbPayload);
  841. }
  842. if (resultCase_ == ResultOneofCase.TextPayload) {
  843. output.WriteRawTag(66);
  844. output.WriteString(TextPayload);
  845. }
  846. if (_unknownFields != null) {
  847. _unknownFields.WriteTo(output);
  848. }
  849. }
  850. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  851. public int CalculateSize() {
  852. int size = 0;
  853. if (resultCase_ == ResultOneofCase.ParseError) {
  854. size += 1 + pb::CodedOutputStream.ComputeStringSize(ParseError);
  855. }
  856. if (resultCase_ == ResultOneofCase.SerializeError) {
  857. size += 1 + pb::CodedOutputStream.ComputeStringSize(SerializeError);
  858. }
  859. if (resultCase_ == ResultOneofCase.RuntimeError) {
  860. size += 1 + pb::CodedOutputStream.ComputeStringSize(RuntimeError);
  861. }
  862. if (resultCase_ == ResultOneofCase.ProtobufPayload) {
  863. size += 1 + pb::CodedOutputStream.ComputeBytesSize(ProtobufPayload);
  864. }
  865. if (resultCase_ == ResultOneofCase.JsonPayload) {
  866. size += 1 + pb::CodedOutputStream.ComputeStringSize(JsonPayload);
  867. }
  868. if (resultCase_ == ResultOneofCase.Skipped) {
  869. size += 1 + pb::CodedOutputStream.ComputeStringSize(Skipped);
  870. }
  871. if (resultCase_ == ResultOneofCase.JspbPayload) {
  872. size += 1 + pb::CodedOutputStream.ComputeStringSize(JspbPayload);
  873. }
  874. if (resultCase_ == ResultOneofCase.TextPayload) {
  875. size += 1 + pb::CodedOutputStream.ComputeStringSize(TextPayload);
  876. }
  877. if (_unknownFields != null) {
  878. size += _unknownFields.CalculateSize();
  879. }
  880. return size;
  881. }
  882. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  883. public void MergeFrom(ConformanceResponse other) {
  884. if (other == null) {
  885. return;
  886. }
  887. switch (other.ResultCase) {
  888. case ResultOneofCase.ParseError:
  889. ParseError = other.ParseError;
  890. break;
  891. case ResultOneofCase.SerializeError:
  892. SerializeError = other.SerializeError;
  893. break;
  894. case ResultOneofCase.RuntimeError:
  895. RuntimeError = other.RuntimeError;
  896. break;
  897. case ResultOneofCase.ProtobufPayload:
  898. ProtobufPayload = other.ProtobufPayload;
  899. break;
  900. case ResultOneofCase.JsonPayload:
  901. JsonPayload = other.JsonPayload;
  902. break;
  903. case ResultOneofCase.Skipped:
  904. Skipped = other.Skipped;
  905. break;
  906. case ResultOneofCase.JspbPayload:
  907. JspbPayload = other.JspbPayload;
  908. break;
  909. case ResultOneofCase.TextPayload:
  910. TextPayload = other.TextPayload;
  911. break;
  912. }
  913. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  914. }
  915. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  916. public void MergeFrom(pb::CodedInputStream input) {
  917. uint tag;
  918. while ((tag = input.ReadTag()) != 0) {
  919. switch(tag) {
  920. default:
  921. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  922. break;
  923. case 10: {
  924. ParseError = input.ReadString();
  925. break;
  926. }
  927. case 18: {
  928. RuntimeError = input.ReadString();
  929. break;
  930. }
  931. case 26: {
  932. ProtobufPayload = input.ReadBytes();
  933. break;
  934. }
  935. case 34: {
  936. JsonPayload = input.ReadString();
  937. break;
  938. }
  939. case 42: {
  940. Skipped = input.ReadString();
  941. break;
  942. }
  943. case 50: {
  944. SerializeError = input.ReadString();
  945. break;
  946. }
  947. case 58: {
  948. JspbPayload = input.ReadString();
  949. break;
  950. }
  951. case 66: {
  952. TextPayload = input.ReadString();
  953. break;
  954. }
  955. }
  956. }
  957. }
  958. }
  959. /// <summary>
  960. /// Encoding options for jspb format.
  961. /// </summary>
  962. public sealed partial class JspbEncodingConfig : pb::IMessage<JspbEncodingConfig> {
  963. private static readonly pb::MessageParser<JspbEncodingConfig> _parser = new pb::MessageParser<JspbEncodingConfig>(() => new JspbEncodingConfig());
  964. private pb::UnknownFieldSet _unknownFields;
  965. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  966. public static pb::MessageParser<JspbEncodingConfig> Parser { get { return _parser; } }
  967. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  968. public static pbr::MessageDescriptor Descriptor {
  969. get { return global::Conformance.ConformanceReflection.Descriptor.MessageTypes[3]; }
  970. }
  971. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  972. pbr::MessageDescriptor pb::IMessage.Descriptor {
  973. get { return Descriptor; }
  974. }
  975. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  976. public JspbEncodingConfig() {
  977. OnConstruction();
  978. }
  979. partial void OnConstruction();
  980. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  981. public JspbEncodingConfig(JspbEncodingConfig other) : this() {
  982. useJspbArrayAnyFormat_ = other.useJspbArrayAnyFormat_;
  983. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  984. }
  985. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  986. public JspbEncodingConfig Clone() {
  987. return new JspbEncodingConfig(this);
  988. }
  989. /// <summary>Field number for the "use_jspb_array_any_format" field.</summary>
  990. public const int UseJspbArrayAnyFormatFieldNumber = 1;
  991. private bool useJspbArrayAnyFormat_;
  992. /// <summary>
  993. /// Encode the value field of Any as jspb array if ture, otherwise binary.
  994. /// </summary>
  995. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  996. public bool UseJspbArrayAnyFormat {
  997. get { return useJspbArrayAnyFormat_; }
  998. set {
  999. useJspbArrayAnyFormat_ = value;
  1000. }
  1001. }
  1002. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1003. public override bool Equals(object other) {
  1004. return Equals(other as JspbEncodingConfig);
  1005. }
  1006. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1007. public bool Equals(JspbEncodingConfig other) {
  1008. if (ReferenceEquals(other, null)) {
  1009. return false;
  1010. }
  1011. if (ReferenceEquals(other, this)) {
  1012. return true;
  1013. }
  1014. if (UseJspbArrayAnyFormat != other.UseJspbArrayAnyFormat) return false;
  1015. return Equals(_unknownFields, other._unknownFields);
  1016. }
  1017. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1018. public override int GetHashCode() {
  1019. int hash = 1;
  1020. if (UseJspbArrayAnyFormat != false) hash ^= UseJspbArrayAnyFormat.GetHashCode();
  1021. if (_unknownFields != null) {
  1022. hash ^= _unknownFields.GetHashCode();
  1023. }
  1024. return hash;
  1025. }
  1026. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1027. public override string ToString() {
  1028. return pb::JsonFormatter.ToDiagnosticString(this);
  1029. }
  1030. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1031. public void WriteTo(pb::CodedOutputStream output) {
  1032. if (UseJspbArrayAnyFormat != false) {
  1033. output.WriteRawTag(8);
  1034. output.WriteBool(UseJspbArrayAnyFormat);
  1035. }
  1036. if (_unknownFields != null) {
  1037. _unknownFields.WriteTo(output);
  1038. }
  1039. }
  1040. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1041. public int CalculateSize() {
  1042. int size = 0;
  1043. if (UseJspbArrayAnyFormat != false) {
  1044. size += 1 + 1;
  1045. }
  1046. if (_unknownFields != null) {
  1047. size += _unknownFields.CalculateSize();
  1048. }
  1049. return size;
  1050. }
  1051. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1052. public void MergeFrom(JspbEncodingConfig other) {
  1053. if (other == null) {
  1054. return;
  1055. }
  1056. if (other.UseJspbArrayAnyFormat != false) {
  1057. UseJspbArrayAnyFormat = other.UseJspbArrayAnyFormat;
  1058. }
  1059. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  1060. }
  1061. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1062. public void MergeFrom(pb::CodedInputStream input) {
  1063. uint tag;
  1064. while ((tag = input.ReadTag()) != 0) {
  1065. switch(tag) {
  1066. default:
  1067. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  1068. break;
  1069. case 8: {
  1070. UseJspbArrayAnyFormat = input.ReadBool();
  1071. break;
  1072. }
  1073. }
  1074. }
  1075. }
  1076. }
  1077. #endregion
  1078. }
  1079. #endregion Designer generated code