Conformance.cs 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: conformance.proto
  3. #pragma warning disable 1591, 0612, 3021
  4. #region Designer generated code
  5. using pb = global::Google.Protobuf;
  6. using pbc = global::Google.Protobuf.Collections;
  7. using pbr = global::Google.Protobuf.Reflection;
  8. using scg = global::System.Collections.Generic;
  9. namespace Conformance {
  10. /// <summary>Holder for reflection information generated from conformance.proto</summary>
  11. public static partial class ConformanceReflection {
  12. #region Descriptor
  13. /// <summary>File descriptor for conformance.proto</summary>
  14. public static pbr::FileDescriptor Descriptor {
  15. get { return descriptor; }
  16. }
  17. private static pbr::FileDescriptor descriptor;
  18. static ConformanceReflection() {
  19. byte[] descriptorData = global::System.Convert.FromBase64String(
  20. string.Concat(
  21. "ChFjb25mb3JtYW5jZS5wcm90bxILY29uZm9ybWFuY2UijQEKEkNvbmZvcm1h",
  22. "bmNlUmVxdWVzdBIaChBwcm90b2J1Zl9wYXlsb2FkGAEgASgMSAASFgoManNv",
  23. "bl9wYXlsb2FkGAIgASgJSAASOAoXcmVxdWVzdGVkX291dHB1dF9mb3JtYXQY",
  24. "AyABKA4yFy5jb25mb3JtYW5jZS5XaXJlRm9ybWF0QgkKB3BheWxvYWQisQEK",
  25. "E0NvbmZvcm1hbmNlUmVzcG9uc2USFQoLcGFyc2VfZXJyb3IYASABKAlIABIZ",
  26. "Cg9zZXJpYWxpemVfZXJyb3IYBiABKAlIABIXCg1ydW50aW1lX2Vycm9yGAIg",
  27. "ASgJSAASGgoQcHJvdG9idWZfcGF5bG9hZBgDIAEoDEgAEhYKDGpzb25fcGF5",
  28. "bG9hZBgEIAEoCUgAEhEKB3NraXBwZWQYBSABKAlIAEIICgZyZXN1bHQqNQoK",
  29. "V2lyZUZvcm1hdBIPCgtVTlNQRUNJRklFRBAAEgwKCFBST1RPQlVGEAESCAoE",
  30. "SlNPThACQiEKH2NvbS5nb29nbGUucHJvdG9idWYuY29uZm9ybWFuY2ViBnBy",
  31. "b3RvMw=="));
  32. descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
  33. new pbr::FileDescriptor[] { },
  34. new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Conformance.WireFormat), }, new pbr::GeneratedClrTypeInfo[] {
  35. new pbr::GeneratedClrTypeInfo(typeof(global::Conformance.ConformanceRequest), global::Conformance.ConformanceRequest.Parser, new[]{ "ProtobufPayload", "JsonPayload", "RequestedOutputFormat" }, new[]{ "Payload" }, null, null),
  36. new pbr::GeneratedClrTypeInfo(typeof(global::Conformance.ConformanceResponse), global::Conformance.ConformanceResponse.Parser, new[]{ "ParseError", "SerializeError", "RuntimeError", "ProtobufPayload", "JsonPayload", "Skipped" }, new[]{ "Result" }, null, null)
  37. }));
  38. }
  39. #endregion
  40. }
  41. #region Enums
  42. public enum WireFormat {
  43. [pbr::OriginalName("UNSPECIFIED")] Unspecified = 0,
  44. [pbr::OriginalName("PROTOBUF")] Protobuf = 1,
  45. [pbr::OriginalName("JSON")] Json = 2,
  46. }
  47. #endregion
  48. #region Messages
  49. /// <summary>
  50. /// Represents a single test case's input. The testee should:
  51. ///
  52. /// 1. parse this proto (which should always succeed)
  53. /// 2. parse the protobuf or JSON payload in "payload" (which may fail)
  54. /// 3. if the parse succeeded, serialize the message in the requested format.
  55. /// </summary>
  56. public sealed partial class ConformanceRequest : pb::IMessage<ConformanceRequest> {
  57. private static readonly pb::MessageParser<ConformanceRequest> _parser = new pb::MessageParser<ConformanceRequest>(() => new ConformanceRequest());
  58. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  59. public static pb::MessageParser<ConformanceRequest> Parser { get { return _parser; } }
  60. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  61. public static pbr::MessageDescriptor Descriptor {
  62. get { return global::Conformance.ConformanceReflection.Descriptor.MessageTypes[0]; }
  63. }
  64. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  65. pbr::MessageDescriptor pb::IMessage.Descriptor {
  66. get { return Descriptor; }
  67. }
  68. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  69. public ConformanceRequest() {
  70. OnConstruction();
  71. }
  72. partial void OnConstruction();
  73. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  74. public ConformanceRequest(ConformanceRequest other) : this() {
  75. requestedOutputFormat_ = other.requestedOutputFormat_;
  76. switch (other.PayloadCase) {
  77. case PayloadOneofCase.ProtobufPayload:
  78. ProtobufPayload = other.ProtobufPayload;
  79. break;
  80. case PayloadOneofCase.JsonPayload:
  81. JsonPayload = other.JsonPayload;
  82. break;
  83. }
  84. }
  85. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  86. public ConformanceRequest Clone() {
  87. return new ConformanceRequest(this);
  88. }
  89. /// <summary>Field number for the "protobuf_payload" field.</summary>
  90. public const int ProtobufPayloadFieldNumber = 1;
  91. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  92. public pb::ByteString ProtobufPayload {
  93. get { return payloadCase_ == PayloadOneofCase.ProtobufPayload ? (pb::ByteString) payload_ : pb::ByteString.Empty; }
  94. set {
  95. payload_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  96. payloadCase_ = PayloadOneofCase.ProtobufPayload;
  97. }
  98. }
  99. /// <summary>Field number for the "json_payload" field.</summary>
  100. public const int JsonPayloadFieldNumber = 2;
  101. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  102. public string JsonPayload {
  103. get { return payloadCase_ == PayloadOneofCase.JsonPayload ? (string) payload_ : ""; }
  104. set {
  105. payload_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  106. payloadCase_ = PayloadOneofCase.JsonPayload;
  107. }
  108. }
  109. /// <summary>Field number for the "requested_output_format" field.</summary>
  110. public const int RequestedOutputFormatFieldNumber = 3;
  111. private global::Conformance.WireFormat requestedOutputFormat_ = 0;
  112. /// <summary>
  113. /// Which format should the testee serialize its message to?
  114. /// </summary>
  115. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  116. public global::Conformance.WireFormat RequestedOutputFormat {
  117. get { return requestedOutputFormat_; }
  118. set {
  119. requestedOutputFormat_ = value;
  120. }
  121. }
  122. private object payload_;
  123. /// <summary>Enum of possible cases for the "payload" oneof.</summary>
  124. public enum PayloadOneofCase {
  125. None = 0,
  126. ProtobufPayload = 1,
  127. JsonPayload = 2,
  128. }
  129. private PayloadOneofCase payloadCase_ = PayloadOneofCase.None;
  130. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  131. public PayloadOneofCase PayloadCase {
  132. get { return payloadCase_; }
  133. }
  134. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  135. public void ClearPayload() {
  136. payloadCase_ = PayloadOneofCase.None;
  137. payload_ = null;
  138. }
  139. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  140. public override bool Equals(object other) {
  141. return Equals(other as ConformanceRequest);
  142. }
  143. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  144. public bool Equals(ConformanceRequest other) {
  145. if (ReferenceEquals(other, null)) {
  146. return false;
  147. }
  148. if (ReferenceEquals(other, this)) {
  149. return true;
  150. }
  151. if (ProtobufPayload != other.ProtobufPayload) return false;
  152. if (JsonPayload != other.JsonPayload) return false;
  153. if (RequestedOutputFormat != other.RequestedOutputFormat) return false;
  154. if (PayloadCase != other.PayloadCase) return false;
  155. return true;
  156. }
  157. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  158. public override int GetHashCode() {
  159. int hash = 1;
  160. if (payloadCase_ == PayloadOneofCase.ProtobufPayload) hash ^= ProtobufPayload.GetHashCode();
  161. if (payloadCase_ == PayloadOneofCase.JsonPayload) hash ^= JsonPayload.GetHashCode();
  162. if (RequestedOutputFormat != 0) hash ^= RequestedOutputFormat.GetHashCode();
  163. hash ^= (int) payloadCase_;
  164. return hash;
  165. }
  166. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  167. public override string ToString() {
  168. return pb::JsonFormatter.ToDiagnosticString(this);
  169. }
  170. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  171. public void WriteTo(pb::CodedOutputStream output) {
  172. if (payloadCase_ == PayloadOneofCase.ProtobufPayload) {
  173. output.WriteRawTag(10);
  174. output.WriteBytes(ProtobufPayload);
  175. }
  176. if (payloadCase_ == PayloadOneofCase.JsonPayload) {
  177. output.WriteRawTag(18);
  178. output.WriteString(JsonPayload);
  179. }
  180. if (RequestedOutputFormat != 0) {
  181. output.WriteRawTag(24);
  182. output.WriteEnum((int) RequestedOutputFormat);
  183. }
  184. }
  185. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  186. public int CalculateSize() {
  187. int size = 0;
  188. if (payloadCase_ == PayloadOneofCase.ProtobufPayload) {
  189. size += 1 + pb::CodedOutputStream.ComputeBytesSize(ProtobufPayload);
  190. }
  191. if (payloadCase_ == PayloadOneofCase.JsonPayload) {
  192. size += 1 + pb::CodedOutputStream.ComputeStringSize(JsonPayload);
  193. }
  194. if (RequestedOutputFormat != 0) {
  195. size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) RequestedOutputFormat);
  196. }
  197. return size;
  198. }
  199. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  200. public void MergeFrom(ConformanceRequest other) {
  201. if (other == null) {
  202. return;
  203. }
  204. if (other.RequestedOutputFormat != 0) {
  205. RequestedOutputFormat = other.RequestedOutputFormat;
  206. }
  207. switch (other.PayloadCase) {
  208. case PayloadOneofCase.ProtobufPayload:
  209. ProtobufPayload = other.ProtobufPayload;
  210. break;
  211. case PayloadOneofCase.JsonPayload:
  212. JsonPayload = other.JsonPayload;
  213. break;
  214. }
  215. }
  216. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  217. public void MergeFrom(pb::CodedInputStream input) {
  218. uint tag;
  219. while ((tag = input.ReadTag()) != 0) {
  220. switch(tag) {
  221. default:
  222. input.SkipLastField();
  223. break;
  224. case 10: {
  225. ProtobufPayload = input.ReadBytes();
  226. break;
  227. }
  228. case 18: {
  229. JsonPayload = input.ReadString();
  230. break;
  231. }
  232. case 24: {
  233. requestedOutputFormat_ = (global::Conformance.WireFormat) input.ReadEnum();
  234. break;
  235. }
  236. }
  237. }
  238. }
  239. }
  240. /// <summary>
  241. /// Represents a single test case's output.
  242. /// </summary>
  243. public sealed partial class ConformanceResponse : pb::IMessage<ConformanceResponse> {
  244. private static readonly pb::MessageParser<ConformanceResponse> _parser = new pb::MessageParser<ConformanceResponse>(() => new ConformanceResponse());
  245. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  246. public static pb::MessageParser<ConformanceResponse> Parser { get { return _parser; } }
  247. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  248. public static pbr::MessageDescriptor Descriptor {
  249. get { return global::Conformance.ConformanceReflection.Descriptor.MessageTypes[1]; }
  250. }
  251. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  252. pbr::MessageDescriptor pb::IMessage.Descriptor {
  253. get { return Descriptor; }
  254. }
  255. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  256. public ConformanceResponse() {
  257. OnConstruction();
  258. }
  259. partial void OnConstruction();
  260. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  261. public ConformanceResponse(ConformanceResponse other) : this() {
  262. switch (other.ResultCase) {
  263. case ResultOneofCase.ParseError:
  264. ParseError = other.ParseError;
  265. break;
  266. case ResultOneofCase.SerializeError:
  267. SerializeError = other.SerializeError;
  268. break;
  269. case ResultOneofCase.RuntimeError:
  270. RuntimeError = other.RuntimeError;
  271. break;
  272. case ResultOneofCase.ProtobufPayload:
  273. ProtobufPayload = other.ProtobufPayload;
  274. break;
  275. case ResultOneofCase.JsonPayload:
  276. JsonPayload = other.JsonPayload;
  277. break;
  278. case ResultOneofCase.Skipped:
  279. Skipped = other.Skipped;
  280. break;
  281. }
  282. }
  283. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  284. public ConformanceResponse Clone() {
  285. return new ConformanceResponse(this);
  286. }
  287. /// <summary>Field number for the "parse_error" field.</summary>
  288. public const int ParseErrorFieldNumber = 1;
  289. /// <summary>
  290. /// This string should be set to indicate parsing failed. The string can
  291. /// provide more information about the parse error if it is available.
  292. ///
  293. /// Setting this string does not necessarily mean the testee failed the
  294. /// test. Some of the test cases are intentionally invalid input.
  295. /// </summary>
  296. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  297. public string ParseError {
  298. get { return resultCase_ == ResultOneofCase.ParseError ? (string) result_ : ""; }
  299. set {
  300. result_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  301. resultCase_ = ResultOneofCase.ParseError;
  302. }
  303. }
  304. /// <summary>Field number for the "serialize_error" field.</summary>
  305. public const int SerializeErrorFieldNumber = 6;
  306. /// <summary>
  307. /// If the input was successfully parsed but errors occurred when
  308. /// serializing it to the requested output format, set the error message in
  309. /// this field.
  310. /// </summary>
  311. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  312. public string SerializeError {
  313. get { return resultCase_ == ResultOneofCase.SerializeError ? (string) result_ : ""; }
  314. set {
  315. result_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  316. resultCase_ = ResultOneofCase.SerializeError;
  317. }
  318. }
  319. /// <summary>Field number for the "runtime_error" field.</summary>
  320. public const int RuntimeErrorFieldNumber = 2;
  321. /// <summary>
  322. /// This should be set if some other error occurred. This will always
  323. /// indicate that the test failed. The string can provide more information
  324. /// about the failure.
  325. /// </summary>
  326. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  327. public string RuntimeError {
  328. get { return resultCase_ == ResultOneofCase.RuntimeError ? (string) result_ : ""; }
  329. set {
  330. result_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  331. resultCase_ = ResultOneofCase.RuntimeError;
  332. }
  333. }
  334. /// <summary>Field number for the "protobuf_payload" field.</summary>
  335. public const int ProtobufPayloadFieldNumber = 3;
  336. /// <summary>
  337. /// If the input was successfully parsed and the requested output was
  338. /// protobuf, serialize it to protobuf and set it in this field.
  339. /// </summary>
  340. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  341. public pb::ByteString ProtobufPayload {
  342. get { return resultCase_ == ResultOneofCase.ProtobufPayload ? (pb::ByteString) result_ : pb::ByteString.Empty; }
  343. set {
  344. result_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  345. resultCase_ = ResultOneofCase.ProtobufPayload;
  346. }
  347. }
  348. /// <summary>Field number for the "json_payload" field.</summary>
  349. public const int JsonPayloadFieldNumber = 4;
  350. /// <summary>
  351. /// If the input was successfully parsed and the requested output was JSON,
  352. /// serialize to JSON and set it in this field.
  353. /// </summary>
  354. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  355. public string JsonPayload {
  356. get { return resultCase_ == ResultOneofCase.JsonPayload ? (string) result_ : ""; }
  357. set {
  358. result_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  359. resultCase_ = ResultOneofCase.JsonPayload;
  360. }
  361. }
  362. /// <summary>Field number for the "skipped" field.</summary>
  363. public const int SkippedFieldNumber = 5;
  364. /// <summary>
  365. /// For when the testee skipped the test, likely because a certain feature
  366. /// wasn't supported, like JSON input/output.
  367. /// </summary>
  368. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  369. public string Skipped {
  370. get { return resultCase_ == ResultOneofCase.Skipped ? (string) result_ : ""; }
  371. set {
  372. result_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  373. resultCase_ = ResultOneofCase.Skipped;
  374. }
  375. }
  376. private object result_;
  377. /// <summary>Enum of possible cases for the "result" oneof.</summary>
  378. public enum ResultOneofCase {
  379. None = 0,
  380. ParseError = 1,
  381. SerializeError = 6,
  382. RuntimeError = 2,
  383. ProtobufPayload = 3,
  384. JsonPayload = 4,
  385. Skipped = 5,
  386. }
  387. private ResultOneofCase resultCase_ = ResultOneofCase.None;
  388. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  389. public ResultOneofCase ResultCase {
  390. get { return resultCase_; }
  391. }
  392. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  393. public void ClearResult() {
  394. resultCase_ = ResultOneofCase.None;
  395. result_ = null;
  396. }
  397. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  398. public override bool Equals(object other) {
  399. return Equals(other as ConformanceResponse);
  400. }
  401. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  402. public bool Equals(ConformanceResponse other) {
  403. if (ReferenceEquals(other, null)) {
  404. return false;
  405. }
  406. if (ReferenceEquals(other, this)) {
  407. return true;
  408. }
  409. if (ParseError != other.ParseError) return false;
  410. if (SerializeError != other.SerializeError) return false;
  411. if (RuntimeError != other.RuntimeError) return false;
  412. if (ProtobufPayload != other.ProtobufPayload) return false;
  413. if (JsonPayload != other.JsonPayload) return false;
  414. if (Skipped != other.Skipped) return false;
  415. if (ResultCase != other.ResultCase) return false;
  416. return true;
  417. }
  418. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  419. public override int GetHashCode() {
  420. int hash = 1;
  421. if (resultCase_ == ResultOneofCase.ParseError) hash ^= ParseError.GetHashCode();
  422. if (resultCase_ == ResultOneofCase.SerializeError) hash ^= SerializeError.GetHashCode();
  423. if (resultCase_ == ResultOneofCase.RuntimeError) hash ^= RuntimeError.GetHashCode();
  424. if (resultCase_ == ResultOneofCase.ProtobufPayload) hash ^= ProtobufPayload.GetHashCode();
  425. if (resultCase_ == ResultOneofCase.JsonPayload) hash ^= JsonPayload.GetHashCode();
  426. if (resultCase_ == ResultOneofCase.Skipped) hash ^= Skipped.GetHashCode();
  427. hash ^= (int) resultCase_;
  428. return hash;
  429. }
  430. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  431. public override string ToString() {
  432. return pb::JsonFormatter.ToDiagnosticString(this);
  433. }
  434. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  435. public void WriteTo(pb::CodedOutputStream output) {
  436. if (resultCase_ == ResultOneofCase.ParseError) {
  437. output.WriteRawTag(10);
  438. output.WriteString(ParseError);
  439. }
  440. if (resultCase_ == ResultOneofCase.RuntimeError) {
  441. output.WriteRawTag(18);
  442. output.WriteString(RuntimeError);
  443. }
  444. if (resultCase_ == ResultOneofCase.ProtobufPayload) {
  445. output.WriteRawTag(26);
  446. output.WriteBytes(ProtobufPayload);
  447. }
  448. if (resultCase_ == ResultOneofCase.JsonPayload) {
  449. output.WriteRawTag(34);
  450. output.WriteString(JsonPayload);
  451. }
  452. if (resultCase_ == ResultOneofCase.Skipped) {
  453. output.WriteRawTag(42);
  454. output.WriteString(Skipped);
  455. }
  456. if (resultCase_ == ResultOneofCase.SerializeError) {
  457. output.WriteRawTag(50);
  458. output.WriteString(SerializeError);
  459. }
  460. }
  461. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  462. public int CalculateSize() {
  463. int size = 0;
  464. if (resultCase_ == ResultOneofCase.ParseError) {
  465. size += 1 + pb::CodedOutputStream.ComputeStringSize(ParseError);
  466. }
  467. if (resultCase_ == ResultOneofCase.SerializeError) {
  468. size += 1 + pb::CodedOutputStream.ComputeStringSize(SerializeError);
  469. }
  470. if (resultCase_ == ResultOneofCase.RuntimeError) {
  471. size += 1 + pb::CodedOutputStream.ComputeStringSize(RuntimeError);
  472. }
  473. if (resultCase_ == ResultOneofCase.ProtobufPayload) {
  474. size += 1 + pb::CodedOutputStream.ComputeBytesSize(ProtobufPayload);
  475. }
  476. if (resultCase_ == ResultOneofCase.JsonPayload) {
  477. size += 1 + pb::CodedOutputStream.ComputeStringSize(JsonPayload);
  478. }
  479. if (resultCase_ == ResultOneofCase.Skipped) {
  480. size += 1 + pb::CodedOutputStream.ComputeStringSize(Skipped);
  481. }
  482. return size;
  483. }
  484. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  485. public void MergeFrom(ConformanceResponse other) {
  486. if (other == null) {
  487. return;
  488. }
  489. switch (other.ResultCase) {
  490. case ResultOneofCase.ParseError:
  491. ParseError = other.ParseError;
  492. break;
  493. case ResultOneofCase.SerializeError:
  494. SerializeError = other.SerializeError;
  495. break;
  496. case ResultOneofCase.RuntimeError:
  497. RuntimeError = other.RuntimeError;
  498. break;
  499. case ResultOneofCase.ProtobufPayload:
  500. ProtobufPayload = other.ProtobufPayload;
  501. break;
  502. case ResultOneofCase.JsonPayload:
  503. JsonPayload = other.JsonPayload;
  504. break;
  505. case ResultOneofCase.Skipped:
  506. Skipped = other.Skipped;
  507. break;
  508. }
  509. }
  510. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  511. public void MergeFrom(pb::CodedInputStream input) {
  512. uint tag;
  513. while ((tag = input.ReadTag()) != 0) {
  514. switch(tag) {
  515. default:
  516. input.SkipLastField();
  517. break;
  518. case 10: {
  519. ParseError = input.ReadString();
  520. break;
  521. }
  522. case 18: {
  523. RuntimeError = input.ReadString();
  524. break;
  525. }
  526. case 26: {
  527. ProtobufPayload = input.ReadBytes();
  528. break;
  529. }
  530. case 34: {
  531. JsonPayload = input.ReadString();
  532. break;
  533. }
  534. case 42: {
  535. Skipped = input.ReadString();
  536. break;
  537. }
  538. case 50: {
  539. SerializeError = input.ReadString();
  540. break;
  541. }
  542. }
  543. }
  544. }
  545. }
  546. #endregion
  547. }
  548. #endregion Designer generated code